From 86053e902853dfeb57cf7ed374b1df967a369679 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 7 Nov 2024 12:30:17 +0900 Subject: [PATCH 001/161] Implement Bulk Deletes API --- app/controllers/api/databases.php | 69 ++++ composer.json | 4 +- composer.lock | 122 +++---- src/Appwrite/Utopia/Response.php | 3 + .../Utopia/Response/Model/BulkOperation.php | 41 +++ .../e2e/Services/Databases/DatabasesBase.php | 300 ++++++++++++++++++ 6 files changed, 476 insertions(+), 63 deletions(-) create mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 84a311e342..f26b1cbb40 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3809,6 +3809,75 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $response->noContent(); }); +App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') + ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) + ->desc('Delete documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.delete') + ->label('audits.event', 'documents.delete') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'databases') + ->label('sdk.method', 'deleteDocuments') + ->label('sdk.description', '/docs/references/databases/delete-documents.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('sdk.offline.key', '{documentId}') + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForUsage') + ->inject('mode') + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Usage $queueForUsage, string $mode) { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + var_dump($queries); + + try { + $modified = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { + return $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries + ); + }); + } catch (NotFoundException $e) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + return $response->dynamic(new Document([ + 'modified' => $modified, + ]), Response::MODEL_BULK_OPERATION); + }); + App::get('/v1/databases/usage') ->desc('Get databases usage stats') ->groups(['api', 'database', 'usage']) diff --git a/composer.json b/composer.json index f122149ec2..237e2e9562 100644 --- a/composer.json +++ b/composer.json @@ -48,10 +48,10 @@ "utopia-php/abuse": "0.43.0", "utopia-php/analytics": "0.10.*", "utopia-php/audit": "0.43.0", - "utopia-php/cache": "0.10.*", + "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.12", + "utopia-php/database": "0.53.17", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 0650710611..e83c8f72fb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "102bab0efa76adc92312b9c5a7f488e3", + "content-hash": "971e88c7387ffd92d755772e0f4e7805", "packages": [ { "name": "adhocore/jwt", @@ -1574,16 +1574,16 @@ }, { "name": "utopia-php/cache", - "version": "0.10.2", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "b22c6eb6d308de246b023efd0fc9758aee8b8247" + "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/b22c6eb6d308de246b023efd0fc9758aee8b8247", - "reference": "b22c6eb6d308de246b023efd0fc9758aee8b8247", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/8ebcab5aac7606331cef69b0081f6c9eff2e58bc", + "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc", "shasum": "" }, "require": { @@ -1594,7 +1594,7 @@ }, "require-dev": { "laravel/pint": "1.2.*", - "phpstan/phpstan": "1.9.x-dev", + "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" }, @@ -1618,9 +1618,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.10.2" + "source": "https://github.com/utopia-php/cache/tree/0.11.0" }, - "time": "2024-06-25T20:36:35+00:00" + "time": "2024-11-05T16:53:58+00:00" }, { "name": "utopia-php/cli", @@ -1724,23 +1724,23 @@ }, { "name": "utopia-php/database", - "version": "0.53.12", + "version": "0.53.17", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "4068d0c5c503ec4562f8c0aa9cfd095889418b83" + "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/4068d0c5c503ec4562f8c0aa9cfd095889418b83", - "reference": "4068d0c5c503ec4562f8c0aa9cfd095889418b83", + "url": "https://api.github.com/repos/utopia-php/database/zipball/07e3e5a1f5dbf9b351aab138085bde06611b305a", + "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-pdo": "*", "php": ">=8.3", - "utopia-php/cache": "0.10.*", + "utopia-php/cache": "0.11.*", "utopia-php/framework": "0.33.*", "utopia-php/mongo": "0.3.*" }, @@ -1774,9 +1774,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.12" + "source": "https://github.com/utopia-php/database/tree/0.53.17" }, - "time": "2024-11-04T07:51:44+00:00" + "time": "2024-11-06T09:20:59+00:00" }, { "name": "utopia-php/domains", @@ -2495,16 +2495,16 @@ }, { "name": "utopia-php/queue", - "version": "0.7.0", + "version": "0.7.1", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "917565256eb94bcab7246f7a746b1a486813761b" + "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/917565256eb94bcab7246f7a746b1a486813761b", - "reference": "917565256eb94bcab7246f7a746b1a486813761b", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/94c240d9f6383829807ce7b2d737f04b159fd3e8", + "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8", "shasum": "" }, "require": { @@ -2550,9 +2550,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.0" + "source": "https://github.com/utopia-php/queue/tree/0.7.1" }, - "time": "2024-01-17T19:00:43+00:00" + "time": "2024-11-05T17:00:38+00:00" }, { "name": "utopia-php/registry", @@ -2608,16 +2608,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.5", + "version": "0.18.6", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919" + "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/7d355c5e3ccc8ecebc0266f8ddd30088a43be919", - "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/893ccf06e183f8ece2aed8dbf14d64d6ba036071", + "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071", "shasum": "" }, "require": { @@ -2657,9 +2657,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.5" + "source": "https://github.com/utopia-php/storage/tree/0.18.6" }, - "time": "2024-09-04T08:57:27+00:00" + "time": "2024-11-06T09:58:50+00:00" }, { "name": "utopia-php/swoole", @@ -2770,22 +2770,22 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.2", + "version": "0.8.3", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18" + "reference": "a032ed0611a8f4467aeaa9484f73223074457337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18", - "reference": "eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a032ed0611a8f4467aeaa9484f73223074457337", + "reference": "a032ed0611a8f4467aeaa9484f73223074457337", "shasum": "" }, "require": { "adhocore/jwt": "^1.1", "php": ">=8.0", - "utopia-php/cache": "^0.10.0", + "utopia-php/cache": "^0.11.0", "utopia-php/framework": "0.*.*" }, "require-dev": { @@ -2813,9 +2813,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.2" + "source": "https://github.com/utopia-php/vcs/tree/0.8.3" }, - "time": "2024-08-13T14:36:30+00:00" + "time": "2024-11-05T17:10:09+00:00" }, { "name": "utopia-php/websocket", @@ -4004,16 +4004,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0c70d2c566e899666f367ab7b80986beb3581e6f", + "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f", "shasum": "" }, "require": { @@ -4026,13 +4026,13 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -4062,9 +4062,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.1" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-11-06T11:58:54+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -5875,16 +5875,16 @@ }, { "name": "symfony/console", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57" + "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", + "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", "shasum": "" }, "require": { @@ -5948,7 +5948,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.6" + "source": "https://github.com/symfony/console/tree/v7.1.7" }, "funding": [ { @@ -5964,7 +5964,7 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:46:59+00:00" + "time": "2024-11-05T15:34:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6546,16 +6546,16 @@ }, { "name": "symfony/process", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e" + "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", - "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", + "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", + "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", "shasum": "" }, "require": { @@ -6587,7 +6587,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.6" + "source": "https://github.com/symfony/process/tree/v7.1.7" }, "funding": [ { @@ -6603,7 +6603,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-06T09:25:12+00:00" }, { "name": "symfony/service-contracts", @@ -6876,16 +6876,16 @@ }, { "name": "twig/twig", - "version": "v3.14.0", + "version": "v3.14.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72" + "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/f405356d20fb43603bcadc8b09bfb676cb04a379", + "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379", "shasum": "" }, "require": { @@ -6939,7 +6939,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.0" + "source": "https://github.com/twigphp/Twig/tree/v3.14.1" }, "funding": [ { @@ -6951,7 +6951,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T17:55:12+00:00" + "time": "2024-11-06T18:17:38+00:00" }, { "name": "webmozart/glob", @@ -7005,7 +7005,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 6cc2639f51..53aa2389ed 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -31,6 +31,7 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; +use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -151,6 +152,7 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; + public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; @@ -482,6 +484,7 @@ class Response extends SwooleResponse ->setModel(new Migration()) ->setModel(new MigrationReport()) ->setModel(new MigrationFirebaseProject()) + ->setModel(new BulkOperation()) // Tests (keep last) ->setModel(new Mock()); diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php new file mode 100644 index 0000000000..15bc8f25f7 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -0,0 +1,41 @@ +addRule('modified', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of documents affected by the operation.', + 'default' => 0, + 'example' => 64, + ]); + + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'BulkOperation'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_BULK_OPERATION; + } +} diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index d079cb313c..567facc54f 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4799,4 +4799,304 @@ trait DatabasesBase $this->assertEquals(408, $response['headers']['status-code']); } + + public function testBulkDeletes(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Deletes', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + for ($x = 0; $x <= $amount; $x++) { + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => $x, + ], + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + } + }; + + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + // TEST: Delete all documents + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(11, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(0, $documents['body']['total']); + + // TEST: Delete documents with query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(6, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertGreaterThanOrEqual(5, $document['number']); + } + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['modified']); + + // SUCCESS: Delete documents with query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(6, $documents['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['modified']); + + // SUCCESS: Delete Documents with limit query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(2)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(9, $documents['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(9, $response['body']['modified']); + + // SUCCESS: Delete Documents with offset query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(5, $documents['body']['total']); + + $lastDoc = end($documents['body']['documents']); + + $this->assertNotEmpty($lastDoc); + $this->assertEquals(4, $lastDoc['number']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['modified']); + + // SUCCESS: Delete over 1k documents + $createBulkDocuments(1000); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(1000, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1000, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(0, $documents['body']['total']); + + // Delete Database + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + } } From bb40455cb761e33dace5c4cc98d316d475030b86 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 7 Nov 2024 12:34:18 +0900 Subject: [PATCH 002/161] Add documentation, update specs --- app/config/specs/open-api3-latest-client.json | 330 +++-- .../specs/open-api3-latest-console.json | 997 ++++++++------- app/config/specs/open-api3-latest-server.json | 766 ++++++----- app/config/specs/swagger2-latest-client.json | 446 ++++--- app/config/specs/swagger2-latest-console.json | 1117 +++++++++-------- app/config/specs/swagger2-latest-server.json | 886 +++++++------ docs/references/databases/delete-documents.md | 1 + 7 files changed, 2599 insertions(+), 1944 deletions(-) create mode 100644 docs/references/databases/delete-documents.md diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 021ae27c45..1c9bfbcd92 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -94,7 +94,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -166,7 +166,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -181,7 +181,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -259,7 +259,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -320,7 +320,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -385,7 +385,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -436,7 +436,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -504,7 +504,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -576,7 +576,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -644,7 +644,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -724,7 +724,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -794,7 +794,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -870,7 +870,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -948,7 +948,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1001,7 +1001,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1052,7 +1052,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1103,7 +1103,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1156,7 +1156,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1228,7 +1228,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1305,7 +1305,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1383,7 +1383,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1434,7 +1434,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1506,7 +1506,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1570,7 +1570,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1585,7 +1585,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1669,7 +1669,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1713,7 +1713,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1766,7 +1766,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1802,7 +1802,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1817,7 +1817,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1893,7 +1893,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1954,7 +1954,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "File" @@ -1962,7 +1962,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2105,7 +2105,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2181,7 +2181,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2257,7 +2257,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2320,7 +2320,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2376,7 +2376,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2441,7 +2441,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2494,7 +2494,7 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, @@ -2575,7 +2575,7 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, @@ -2655,7 +2655,7 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, @@ -2703,7 +2703,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2718,7 +2718,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2784,7 +2784,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2799,7 +2799,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2873,7 +2873,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2881,7 +2881,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3009,7 +3009,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3024,7 +3024,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3088,7 +3088,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3103,7 +3103,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3173,7 +3173,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3251,7 +3251,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3305,7 +3305,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3368,7 +3368,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3376,7 +3376,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3496,7 +3496,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3504,7 +3504,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3628,7 +3628,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3636,7 +3636,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3688,7 +3688,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3696,7 +3696,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -4178,7 +4178,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -4186,7 +4186,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4262,7 +4262,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -4270,7 +4270,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4356,7 +4356,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4364,7 +4364,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4465,7 +4465,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -4552,7 +4552,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -4637,6 +4637,92 @@ } } } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -4661,7 +4747,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -4758,7 +4844,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -4859,7 +4945,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -4945,7 +5031,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5033,7 +5119,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5084,7 +5170,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -5150,7 +5236,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5226,7 +5312,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5280,7 +5366,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5319,7 +5405,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -5334,7 +5420,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5388,7 +5474,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5442,7 +5528,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5496,7 +5582,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5550,7 +5636,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5604,7 +5690,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5658,7 +5744,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5712,7 +5798,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5766,7 +5852,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5851,7 +5937,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -5928,7 +6014,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -6001,7 +6087,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -6016,7 +6102,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6116,7 +6202,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6190,7 +6276,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6281,7 +6367,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6350,7 +6436,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6419,7 +6505,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6637,7 +6723,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6713,7 +6799,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6791,7 +6877,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -6878,7 +6964,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6942,7 +7028,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7018,7 +7104,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7084,7 +7170,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7157,7 +7243,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -7172,7 +7258,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7285,7 +7371,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7344,7 +7430,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -7359,7 +7445,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7448,7 +7534,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7509,7 +7595,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -7524,7 +7610,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7624,7 +7710,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7687,7 +7773,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -9826,7 +9912,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -9848,6 +9934,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -9857,7 +9948,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 04e7c76e13..bddfb81090 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -93,7 +93,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -171,7 +171,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 9, + "weight": 10, "cookies": false, "type": "", "deprecated": false, @@ -206,7 +206,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -221,7 +221,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -298,7 +298,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -358,7 +358,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -422,7 +422,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -473,7 +473,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -540,7 +540,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -611,7 +611,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -678,7 +678,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -757,7 +757,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -826,7 +826,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -902,7 +902,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -979,7 +979,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1031,7 +1031,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1081,7 +1081,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1131,7 +1131,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1183,7 +1183,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1254,7 +1254,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1330,7 +1330,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1407,7 +1407,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1457,7 +1457,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1528,7 +1528,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1591,7 +1591,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1606,7 +1606,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1689,7 +1689,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1732,7 +1732,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1784,7 +1784,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1820,7 +1820,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1835,7 +1835,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1911,7 +1911,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1972,7 +1972,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "File" @@ -1980,7 +1980,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2123,7 +2123,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2199,7 +2199,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2275,7 +2275,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2337,7 +2337,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2392,7 +2392,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2456,7 +2456,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2508,7 +2508,7 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, @@ -2588,7 +2588,7 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, @@ -2667,7 +2667,7 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, @@ -2714,7 +2714,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2729,7 +2729,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2795,7 +2795,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2810,7 +2810,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2884,7 +2884,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2892,7 +2892,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3020,7 +3020,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3035,7 +3035,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3099,7 +3099,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3114,7 +3114,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3183,7 +3183,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3260,7 +3260,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3313,7 +3313,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3375,7 +3375,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3383,7 +3383,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3503,7 +3503,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3511,7 +3511,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3635,7 +3635,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3643,7 +3643,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3695,7 +3695,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3703,7 +3703,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -4185,7 +4185,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -4193,7 +4193,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4269,7 +4269,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -4277,7 +4277,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4363,7 +4363,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4371,7 +4371,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4465,7 +4465,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4534,7 +4534,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4584,7 +4584,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4644,7 +4644,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4659,7 +4659,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4740,7 +4740,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 113, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -4814,7 +4814,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4875,7 +4875,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4953,7 +4953,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -5016,7 +5016,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -5101,7 +5101,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -5207,7 +5207,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -5278,7 +5278,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -5379,7 +5379,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5452,7 +5452,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5523,7 +5523,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5538,7 +5538,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5646,7 +5646,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5759,7 +5759,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5867,7 +5867,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5965,7 +5965,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5980,7 +5980,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -6073,7 +6073,7 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -6088,7 +6088,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -6186,7 +6186,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6201,7 +6201,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -6303,7 +6303,7 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -6318,7 +6318,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6425,7 +6425,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6440,7 +6440,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6543,7 +6543,7 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6558,7 +6558,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6668,7 +6668,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6683,7 +6683,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6786,7 +6786,7 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6801,7 +6801,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6911,7 +6911,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6926,7 +6926,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -7019,7 +7019,7 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -7034,7 +7034,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -7132,7 +7132,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -7147,7 +7147,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -7265,7 +7265,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -7280,7 +7280,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -7384,7 +7384,7 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -7399,7 +7399,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7477,7 +7477,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7502,7 +7502,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7517,7 +7517,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7610,7 +7610,7 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7625,7 +7625,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7769,7 +7769,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7842,7 +7842,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7909,7 +7909,7 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -7924,7 +7924,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -8034,7 +8034,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -8121,7 +8121,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -8206,6 +8206,92 @@ } } } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -8230,7 +8316,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -8327,7 +8413,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8428,7 +8514,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8514,7 +8600,7 @@ }, "x-appwrite": { "method": "listDocumentLogs", - "weight": 110, + "weight": 111, "cookies": false, "type": "", "deprecated": false, @@ -8609,7 +8695,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8678,7 +8764,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8693,7 +8779,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8815,7 +8901,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8888,7 +8974,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8970,7 +9056,7 @@ }, "x-appwrite": { "method": "listCollectionLogs", - "weight": 77, + "weight": 78, "cookies": false, "type": "", "deprecated": false, @@ -9055,7 +9141,7 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -9149,7 +9235,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 71, + "weight": 72, "cookies": false, "type": "", "deprecated": false, @@ -9224,7 +9310,7 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 114, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -9308,7 +9394,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9383,7 +9469,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9437,6 +9523,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9455,6 +9542,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9462,24 +9551,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -9622,7 +9717,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9658,7 +9753,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -9673,7 +9768,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9725,7 +9820,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9827,7 +9922,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9889,7 +9984,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -9963,7 +10058,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -10024,7 +10119,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10085,6 +10180,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -10103,6 +10199,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -10110,24 +10208,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -10240,7 +10344,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10303,7 +10407,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10373,7 +10477,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10388,7 +10492,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10486,7 +10590,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10557,7 +10661,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10621,7 +10725,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10687,7 +10791,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10774,7 +10878,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10840,7 +10944,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -10915,7 +11019,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11003,7 +11107,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11054,7 +11158,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -11120,7 +11224,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11179,7 +11283,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -11187,7 +11291,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11260,7 +11364,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -11344,7 +11448,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11405,7 +11509,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11493,7 +11597,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11564,7 +11668,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11652,7 +11756,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11725,7 +11829,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11779,7 +11883,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -11833,7 +11937,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -11884,7 +11988,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11935,7 +12039,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11986,7 +12090,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12048,7 +12152,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12099,7 +12203,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12150,7 +12254,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12201,7 +12305,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12265,7 +12369,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12329,7 +12433,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12404,7 +12508,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12453,7 +12557,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -12468,7 +12572,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12558,7 +12662,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12622,7 +12726,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12686,7 +12790,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12750,7 +12854,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12814,7 +12918,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12878,7 +12982,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12942,7 +13046,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13006,7 +13110,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13070,7 +13174,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13121,7 +13225,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13172,7 +13276,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13208,7 +13312,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -13223,7 +13327,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13277,7 +13381,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13331,7 +13435,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13385,7 +13489,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13439,7 +13543,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13493,7 +13597,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13547,7 +13651,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13601,7 +13705,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13655,7 +13759,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13733,7 +13837,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13864,7 +13968,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13879,7 +13983,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -14027,7 +14131,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14169,7 +14273,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14184,7 +14288,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -14343,7 +14447,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14439,7 +14543,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14454,7 +14558,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -14553,7 +14657,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14568,7 +14672,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14623,7 +14727,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -14687,7 +14791,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14764,7 +14868,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14841,7 +14945,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14919,7 +15023,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15026,7 +15130,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -15136,7 +15240,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15223,7 +15327,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -15313,7 +15417,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15430,7 +15534,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15550,7 +15654,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15647,7 +15751,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15747,7 +15851,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15854,7 +15958,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15964,7 +16068,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16109,7 +16213,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16256,7 +16360,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -16353,7 +16457,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16453,7 +16557,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16550,7 +16654,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16650,7 +16754,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16747,7 +16851,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16847,7 +16951,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16944,7 +17048,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17029,7 +17133,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -17044,7 +17148,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -17099,7 +17203,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17163,7 +17267,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -17240,7 +17344,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -17317,7 +17421,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17393,7 +17497,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17463,7 +17567,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17478,7 +17582,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17525,7 +17629,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17540,7 +17644,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17619,7 +17723,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17683,7 +17787,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17760,7 +17864,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -17846,7 +17950,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17923,7 +18027,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -17938,7 +18042,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -18003,7 +18107,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -18080,7 +18184,7 @@ }, "x-appwrite": { "method": "list", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18109,7 +18213,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "schema": { "type": "array", @@ -18156,7 +18260,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18246,7 +18350,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18341,7 +18445,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18412,7 +18516,7 @@ }, "x-appwrite": { "method": "deleteFirebaseAuth", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18462,7 +18566,7 @@ }, "x-appwrite": { "method": "createFirebaseOAuthMigration", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18540,7 +18644,7 @@ }, "x-appwrite": { "method": "listFirebaseProjects", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18590,7 +18694,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18664,7 +18768,7 @@ }, "x-appwrite": { "method": "getFirebaseReportOAuth", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18738,7 +18842,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18851,7 +18955,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18986,7 +19090,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -19093,7 +19197,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -19219,7 +19323,7 @@ }, "x-appwrite": { "method": "get", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -19279,7 +19383,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -19332,7 +19436,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -19394,7 +19498,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -19484,7 +19588,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19532,7 +19636,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19607,7 +19711,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19667,7 +19771,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19744,7 +19848,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19806,7 +19910,7 @@ }, "x-appwrite": { "method": "list", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19880,7 +19984,7 @@ }, "x-appwrite": { "method": "create", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -20017,7 +20121,7 @@ }, "x-appwrite": { "method": "get", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -20077,7 +20181,7 @@ }, "x-appwrite": { "method": "update", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20194,7 +20298,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20256,7 +20360,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20350,7 +20454,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20431,7 +20535,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20512,7 +20616,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20593,7 +20697,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20674,7 +20778,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20758,7 +20862,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20839,7 +20943,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20920,7 +21024,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21001,7 +21105,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21082,7 +21186,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -21184,7 +21288,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21273,7 +21377,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -21333,7 +21437,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -21428,7 +21532,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21498,7 +21602,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21594,7 +21698,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21666,7 +21770,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21805,7 +21909,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21865,7 +21969,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21986,7 +22090,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22056,7 +22160,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22153,7 +22257,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22225,7 +22329,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22327,7 +22431,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22408,7 +22512,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22528,7 +22632,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22661,7 +22765,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 153, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22742,7 +22846,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22968,7 +23072,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23234,7 +23338,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23462,7 +23566,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -23685,7 +23789,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23927,7 +24031,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -24152,7 +24256,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24212,7 +24316,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -24329,7 +24433,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24399,7 +24503,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24517,7 +24621,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24589,7 +24693,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24661,7 +24765,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24735,7 +24839,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -24821,7 +24925,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24874,7 +24978,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24936,7 +25040,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24998,7 +25102,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25073,7 +25177,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25202,7 +25306,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25263,7 +25367,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25389,7 +25493,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25452,7 +25556,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25525,7 +25629,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -25540,7 +25644,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -25640,7 +25744,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25714,7 +25818,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -25805,7 +25909,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25874,7 +25978,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25943,7 +26047,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -26161,7 +26265,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26237,7 +26341,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 214, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -26311,7 +26415,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 215, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26395,7 +26499,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26473,7 +26577,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26560,7 +26664,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26624,7 +26728,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26700,7 +26804,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26766,7 +26870,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26841,7 +26945,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26914,7 +27018,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -26929,7 +27033,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27042,7 +27146,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27101,7 +27205,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -27116,7 +27220,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27205,7 +27309,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27266,7 +27370,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -27281,7 +27385,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27380,7 +27484,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27442,7 +27546,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27525,7 +27629,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -27600,7 +27704,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -27690,7 +27794,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27777,7 +27881,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27864,7 +27968,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -27934,7 +28038,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -27997,7 +28101,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28084,7 +28188,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28171,7 +28275,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28288,7 +28392,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28393,7 +28497,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28500,7 +28604,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28574,7 +28678,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -28628,7 +28732,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -28691,7 +28795,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28773,7 +28877,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -28842,7 +28946,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -28857,7 +28961,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -28942,7 +29046,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29018,7 +29122,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29081,7 +29185,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29163,7 +29267,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29241,7 +29345,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29304,7 +29408,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29365,7 +29469,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29426,7 +29530,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29489,7 +29593,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -29571,7 +29675,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29653,7 +29757,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29735,7 +29839,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -29796,7 +29900,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29878,7 +29982,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29924,7 +30028,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -29939,7 +30043,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29993,7 +30097,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30049,7 +30153,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30122,7 +30226,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30204,7 +30308,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30279,7 +30383,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30391,7 +30495,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30463,7 +30567,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30554,7 +30658,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -30613,7 +30717,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -30628,7 +30732,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -30712,7 +30816,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -30794,7 +30898,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -30876,7 +30980,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30947,7 +31051,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -31034,7 +31138,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 279, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -31106,7 +31210,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 280, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -31178,7 +31282,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -31261,7 +31365,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31342,7 +31446,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -31433,7 +31537,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -31509,7 +31613,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31562,7 +31666,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -35050,7 +35154,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -36046,6 +36150,17 @@ "description": "SMTP server secure protocol", "x-example": "tls" }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -36173,6 +36288,8 @@ "smtpUsername", "smtpPassword", "smtpSecure", + "pingCount", + "pingedAt", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -37736,7 +37853,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38374,7 +38491,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38396,6 +38513,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38405,7 +38527,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -38419,7 +38542,7 @@ }, "$createdAt": { "type": "string", - "description": "Variable creation date in ISO 8601 format.", + "description": "Migration creation date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$updatedAt": { @@ -38442,9 +38565,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -38478,6 +38606,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 274eac9686..944f473b8b 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -95,7 +95,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -167,7 +167,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -182,7 +182,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -261,7 +261,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -323,7 +323,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -389,7 +389,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -440,7 +440,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -509,7 +509,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -582,7 +582,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -651,7 +651,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -732,7 +732,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -803,7 +803,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -879,7 +879,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -958,7 +958,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1012,7 +1012,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1064,7 +1064,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1116,7 +1116,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1170,7 +1170,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1243,7 +1243,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1321,7 +1321,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1400,7 +1400,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1452,7 +1452,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1525,7 +1525,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1590,7 +1590,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1605,7 +1605,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1690,7 +1690,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1735,7 +1735,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1789,7 +1789,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1825,7 +1825,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1840,7 +1840,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1916,7 +1916,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1992,7 +1992,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2068,7 +2068,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2144,7 +2144,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2208,7 +2208,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2265,7 +2265,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2331,7 +2331,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2370,7 +2370,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2385,7 +2385,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2451,7 +2451,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2466,7 +2466,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2540,7 +2540,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2548,7 +2548,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2676,7 +2676,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2691,7 +2691,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -2755,7 +2755,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -2770,7 +2770,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -2841,7 +2841,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -2920,7 +2920,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -2975,7 +2975,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3039,7 +3039,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3047,7 +3047,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3169,7 +3169,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3177,7 +3177,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3303,7 +3303,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3311,7 +3311,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3365,7 +3365,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3373,7 +3373,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3857,7 +3857,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3865,7 +3865,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -3943,7 +3943,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3951,7 +3951,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4039,7 +4039,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4047,7 +4047,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4150,7 +4150,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4211,7 +4211,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4226,7 +4226,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4308,7 +4308,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4370,7 +4370,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4449,7 +4449,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -4513,7 +4513,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -4599,7 +4599,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -4706,7 +4706,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -4778,7 +4778,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -4880,7 +4880,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -4954,7 +4954,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5026,7 +5026,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5041,7 +5041,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5150,7 +5150,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5264,7 +5264,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5373,7 +5373,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5472,7 +5472,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5487,7 +5487,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -5581,7 +5581,7 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -5596,7 +5596,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -5695,7 +5695,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5710,7 +5710,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -5813,7 +5813,7 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -5828,7 +5828,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -5936,7 +5936,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -5951,7 +5951,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6055,7 +6055,7 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6070,7 +6070,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6181,7 +6181,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6196,7 +6196,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6300,7 +6300,7 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6315,7 +6315,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6426,7 +6426,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6441,7 +6441,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -6535,7 +6535,7 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -6550,7 +6550,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -6649,7 +6649,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -6664,7 +6664,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -6783,7 +6783,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -6798,7 +6798,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -6903,7 +6903,7 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -6918,7 +6918,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -6997,7 +6997,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7022,7 +7022,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7037,7 +7037,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7131,7 +7131,7 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7146,7 +7146,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7291,7 +7291,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7365,7 +7365,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7433,7 +7433,7 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -7448,7 +7448,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -7559,7 +7559,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -7648,7 +7648,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -7735,6 +7735,94 @@ } } } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7759,7 +7847,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -7858,7 +7946,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -7961,7 +8049,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8049,7 +8137,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8119,7 +8207,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8134,7 +8222,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8257,7 +8345,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8331,7 +8419,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8414,7 +8502,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8490,7 +8578,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8545,6 +8633,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8563,6 +8652,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8570,24 +8661,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -8730,7 +8827,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8767,7 +8864,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -8782,7 +8879,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8835,7 +8932,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8897,7 +8994,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -8959,6 +9056,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8977,6 +9075,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8984,24 +9084,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -9114,7 +9220,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9178,7 +9284,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9249,7 +9355,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9264,7 +9370,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9363,7 +9469,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9435,7 +9541,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9500,7 +9606,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9567,7 +9673,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9655,7 +9761,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9722,7 +9828,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9798,7 +9904,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9888,7 +9994,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9941,7 +10047,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -10007,7 +10113,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10068,7 +10174,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -10076,7 +10182,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10150,7 +10256,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10212,7 +10318,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10301,7 +10407,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10373,7 +10479,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10462,7 +10568,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10536,7 +10642,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10592,7 +10698,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10648,7 +10754,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -10700,7 +10806,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -10752,7 +10858,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -10804,7 +10910,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -10867,7 +10973,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10919,7 +11025,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10971,7 +11077,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11023,7 +11129,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11088,7 +11194,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11153,7 +11259,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11229,7 +11335,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11279,7 +11385,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -11294,7 +11400,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11385,7 +11491,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11450,7 +11556,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11515,7 +11621,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11580,7 +11686,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11645,7 +11751,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11710,7 +11816,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11775,7 +11881,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11840,7 +11946,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11905,7 +12011,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11957,7 +12063,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12009,7 +12115,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12046,7 +12152,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -12061,7 +12167,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12117,7 +12223,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12173,7 +12279,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12229,7 +12335,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12285,7 +12391,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12341,7 +12447,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12397,7 +12503,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12453,7 +12559,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12509,7 +12615,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12588,7 +12694,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -12720,7 +12826,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -12735,7 +12841,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -12884,7 +12990,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13027,7 +13133,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13042,7 +13148,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -13202,7 +13308,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13299,7 +13405,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13314,7 +13420,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -13414,7 +13520,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13429,7 +13535,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13485,7 +13591,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -13550,7 +13656,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13628,7 +13734,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13706,7 +13812,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13785,7 +13891,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13893,7 +13999,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -14004,7 +14110,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14092,7 +14198,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -14183,7 +14289,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -14301,7 +14407,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14422,7 +14528,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14520,7 +14626,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14621,7 +14727,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -14729,7 +14835,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14840,7 +14946,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14986,7 +15092,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15134,7 +15240,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15232,7 +15338,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15333,7 +15439,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15431,7 +15537,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15532,7 +15638,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15630,7 +15736,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15731,7 +15837,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15829,7 +15935,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -15915,7 +16021,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -15930,7 +16036,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15986,7 +16092,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16051,7 +16157,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16129,7 +16235,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -16207,7 +16313,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16284,7 +16390,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16355,7 +16461,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16370,7 +16476,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16418,7 +16524,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16433,7 +16539,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16513,7 +16619,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16578,7 +16684,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16656,7 +16762,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -16743,7 +16849,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -16822,7 +16928,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -16837,7 +16943,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -16903,7 +17009,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -16982,7 +17088,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17058,7 +17164,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17188,7 +17294,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17250,7 +17356,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17377,7 +17483,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17441,7 +17547,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17516,7 +17622,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -17531,7 +17637,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -17633,7 +17739,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17709,7 +17815,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -17802,7 +17908,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17873,7 +17979,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -17944,7 +18050,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -18164,7 +18270,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18242,7 +18348,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18322,7 +18428,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18411,7 +18517,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18477,7 +18583,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18555,7 +18661,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18623,7 +18729,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18698,7 +18804,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -18713,7 +18819,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18828,7 +18934,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18889,7 +18995,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -18904,7 +19010,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18995,7 +19101,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19058,7 +19164,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -19073,7 +19179,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19174,7 +19280,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19238,7 +19344,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19323,7 +19429,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19399,7 +19505,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19490,7 +19596,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19578,7 +19684,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19666,7 +19772,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -19737,7 +19843,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -19801,7 +19907,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19889,7 +19995,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19977,7 +20083,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20095,7 +20201,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20201,7 +20307,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20309,7 +20415,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20364,7 +20470,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20428,7 +20534,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20511,7 +20617,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -20581,7 +20687,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -20596,7 +20702,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -20682,7 +20788,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20759,7 +20865,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -20823,7 +20929,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -20906,7 +21012,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20985,7 +21091,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21049,7 +21155,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21111,7 +21217,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21173,7 +21279,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21237,7 +21343,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21320,7 +21426,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21403,7 +21509,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21486,7 +21592,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -21548,7 +21654,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21631,7 +21737,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21678,7 +21784,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -21693,7 +21799,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21748,7 +21854,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21805,7 +21911,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21879,7 +21985,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -21962,7 +22068,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -22038,7 +22144,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22151,7 +22257,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22224,7 +22330,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22316,7 +22422,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22376,7 +22482,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -22391,7 +22497,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22476,7 +22582,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -22559,7 +22665,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -25780,7 +25886,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -26592,7 +26698,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27040,7 +27146,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27062,6 +27168,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27071,7 +27182,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index fce6a871a3..1aeb51e466 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -87,7 +87,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -140,7 +140,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -222,7 +222,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -233,7 +233,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -315,7 +315,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -379,7 +379,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -444,7 +444,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -497,7 +497,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -566,7 +566,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -641,7 +641,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -709,7 +709,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -790,7 +790,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -860,7 +860,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -934,7 +934,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -1016,7 +1016,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1071,7 +1071,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1124,7 +1124,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1177,7 +1177,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1232,7 +1232,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1307,7 +1307,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1388,7 +1388,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1470,7 +1470,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1523,7 +1523,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1598,7 +1598,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1670,7 +1670,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1681,7 +1681,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1770,7 +1770,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1818,7 +1818,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1873,7 +1873,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1915,7 +1915,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1926,7 +1926,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -2006,7 +2006,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2075,7 +2075,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "No content" @@ -2083,7 +2083,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2221,7 +2221,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2301,7 +2301,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2381,7 +2381,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2444,7 +2444,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2502,7 +2502,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2567,7 +2567,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2622,7 +2622,7 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, @@ -2708,7 +2708,7 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, @@ -2784,7 +2784,7 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, @@ -2836,7 +2836,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2847,7 +2847,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2922,7 +2922,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2933,7 +2933,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -3017,7 +3017,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -3025,7 +3025,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3152,7 +3152,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3163,7 +3163,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3235,7 +3235,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3246,7 +3246,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3319,7 +3319,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3401,7 +3401,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3457,7 +3457,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3528,7 +3528,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3539,7 +3539,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3657,7 +3657,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3668,7 +3668,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3790,7 +3790,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3801,7 +3801,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3857,7 +3857,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3868,7 +3868,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -4348,7 +4348,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4359,7 +4359,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4435,7 +4435,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4446,7 +4446,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4530,7 +4530,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4541,7 +4541,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4636,7 +4636,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -4720,7 +4720,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -4802,6 +4802,94 @@ } } ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -4828,7 +4916,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -4920,7 +5008,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -5019,7 +5107,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -5101,7 +5189,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5167,7 +5255,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -5186,7 +5274,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5226,65 +5314,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -5313,7 +5395,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5387,7 +5469,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5463,7 +5545,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5528,7 +5610,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -5539,7 +5621,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5595,7 +5677,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5651,7 +5733,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5707,7 +5789,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5763,7 +5845,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5819,7 +5901,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5875,7 +5957,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5931,7 +6013,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5987,7 +6069,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -6076,7 +6158,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -6151,7 +6233,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -6225,7 +6307,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -6236,7 +6318,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6330,7 +6412,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6402,7 +6484,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6493,7 +6575,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6567,7 +6649,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6641,7 +6723,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6842,7 +6924,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6916,7 +6998,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6993,7 +7075,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -7087,7 +7169,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -7151,7 +7233,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7228,7 +7310,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7294,7 +7376,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7368,7 +7450,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -7379,7 +7461,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7496,7 +7578,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7557,7 +7639,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -7568,7 +7650,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7656,7 +7738,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7719,7 +7801,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -7730,7 +7812,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7828,7 +7910,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7891,7 +7973,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -9590,7 +9672,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -10014,7 +10096,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -10036,6 +10118,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -10045,7 +10132,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 9200c80593..444b03bff3 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -99,7 +99,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -151,7 +151,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -237,7 +237,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 9, + "weight": 10, "cookies": false, "type": "", "deprecated": false, @@ -278,7 +278,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -289,7 +289,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -370,7 +370,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -433,7 +433,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -497,7 +497,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -550,7 +550,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -618,7 +618,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -692,7 +692,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -759,7 +759,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -839,7 +839,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -908,7 +908,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -982,7 +982,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -1063,7 +1063,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1117,7 +1117,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1169,7 +1169,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1221,7 +1221,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1275,7 +1275,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1349,7 +1349,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1429,7 +1429,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1510,7 +1510,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1562,7 +1562,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1636,7 +1636,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1707,7 +1707,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1718,7 +1718,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1806,7 +1806,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1853,7 +1853,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1907,7 +1907,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1949,7 +1949,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1960,7 +1960,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -2040,7 +2040,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2109,7 +2109,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "No content" @@ -2117,7 +2117,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2255,7 +2255,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2335,7 +2335,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2415,7 +2415,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2477,7 +2477,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2534,7 +2534,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2598,7 +2598,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2652,7 +2652,7 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, @@ -2737,7 +2737,7 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, @@ -2812,7 +2812,7 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, @@ -2863,7 +2863,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2874,7 +2874,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2949,7 +2949,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2960,7 +2960,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -3044,7 +3044,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -3052,7 +3052,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3179,7 +3179,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3190,7 +3190,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3262,7 +3262,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3273,7 +3273,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3345,7 +3345,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3426,7 +3426,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3481,7 +3481,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3551,7 +3551,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3562,7 +3562,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3680,7 +3680,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3691,7 +3691,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3813,7 +3813,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3824,7 +3824,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3880,7 +3880,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3891,7 +3891,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -4371,7 +4371,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4382,7 +4382,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4458,7 +4458,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4469,7 +4469,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4553,7 +4553,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4564,7 +4564,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4659,7 +4659,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4731,7 +4731,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4783,7 +4783,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4846,7 +4846,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4857,7 +4857,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4943,7 +4943,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 113, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -5017,7 +5017,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -5078,7 +5078,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -5158,7 +5158,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -5221,7 +5221,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -5303,7 +5303,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -5412,7 +5412,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -5481,7 +5481,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -5584,7 +5584,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5655,7 +5655,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5727,7 +5727,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5738,7 +5738,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5844,7 +5844,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5954,7 +5954,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -6060,7 +6060,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -6159,7 +6159,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -6170,7 +6170,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -6265,7 +6265,7 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -6276,7 +6276,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -6375,7 +6375,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6386,7 +6386,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -6491,7 +6491,7 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -6502,7 +6502,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6611,7 +6611,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6622,7 +6622,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6729,7 +6729,7 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6740,7 +6740,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6853,7 +6853,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6864,7 +6864,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6971,7 +6971,7 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6982,7 +6982,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -7095,7 +7095,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -7106,7 +7106,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -7201,7 +7201,7 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -7212,7 +7212,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -7311,7 +7311,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -7322,7 +7322,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -7446,7 +7446,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -7457,7 +7457,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -7565,7 +7565,7 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -7576,7 +7576,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7650,7 +7650,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7681,7 +7681,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7692,7 +7692,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7787,7 +7787,7 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7798,7 +7798,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7939,7 +7939,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -8010,7 +8010,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -8075,7 +8075,7 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -8086,7 +8086,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -8192,7 +8192,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -8276,7 +8276,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -8358,6 +8358,94 @@ } } ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -8384,7 +8472,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -8476,7 +8564,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8575,7 +8663,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8657,7 +8745,7 @@ }, "x-appwrite": { "method": "listDocumentLogs", - "weight": 110, + "weight": 111, "cookies": false, "type": "", "deprecated": false, @@ -8747,7 +8835,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8817,7 +8905,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8828,7 +8916,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8950,7 +9038,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -9021,7 +9109,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -9099,7 +9187,7 @@ }, "x-appwrite": { "method": "listCollectionLogs", - "weight": 77, + "weight": 78, "cookies": false, "type": "", "deprecated": false, @@ -9181,7 +9269,7 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -9271,7 +9359,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 71, + "weight": 72, "cookies": false, "type": "", "deprecated": false, @@ -9345,7 +9433,7 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 114, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -9427,7 +9515,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9501,7 +9589,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9559,6 +9647,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9577,6 +9666,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9584,24 +9675,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -9726,7 +9823,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9764,7 +9861,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9806,7 +9903,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -9817,7 +9914,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9871,7 +9968,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9969,7 +10066,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -10031,7 +10128,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -10105,7 +10202,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -10166,7 +10263,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10226,6 +10323,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -10244,6 +10342,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -10251,24 +10351,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -10370,7 +10476,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -10399,7 +10505,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10462,7 +10568,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10533,7 +10639,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10544,7 +10650,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10638,7 +10744,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10707,7 +10813,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10771,7 +10877,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10837,7 +10943,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10921,7 +11027,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10992,7 +11098,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -11065,7 +11171,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11131,7 +11237,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -11150,7 +11256,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11190,65 +11296,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -11277,7 +11377,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11336,7 +11436,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -11344,7 +11444,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11415,7 +11515,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -11497,7 +11597,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11558,7 +11658,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11646,7 +11746,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11715,7 +11815,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11803,7 +11903,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11874,7 +11974,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11950,7 +12050,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -12026,7 +12126,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12079,7 +12179,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12132,7 +12232,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12185,7 +12285,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12247,7 +12347,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12300,7 +12400,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12353,7 +12453,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12406,7 +12506,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12470,7 +12570,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12534,7 +12634,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12607,7 +12707,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12660,7 +12760,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -12671,7 +12771,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12759,7 +12859,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12823,7 +12923,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12887,7 +12987,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12951,7 +13051,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -13015,7 +13115,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -13079,7 +13179,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -13143,7 +13243,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13207,7 +13307,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13271,7 +13371,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13324,7 +13424,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13377,7 +13477,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13419,7 +13519,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -13430,7 +13530,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13486,7 +13586,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13542,7 +13642,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13598,7 +13698,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13654,7 +13754,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13710,7 +13810,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13766,7 +13866,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13822,7 +13922,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13878,7 +13978,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13955,7 +14055,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14104,7 +14204,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14115,7 +14215,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -14272,7 +14372,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14436,7 +14536,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14447,7 +14547,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -14619,7 +14719,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14728,7 +14828,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14739,7 +14839,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -14846,7 +14946,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14857,7 +14957,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14916,7 +15016,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -14980,7 +15080,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -15056,7 +15156,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -15132,7 +15232,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15209,7 +15309,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15326,7 +15426,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -15441,7 +15541,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15534,7 +15634,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -15625,7 +15725,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15754,7 +15854,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15881,7 +15981,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15986,7 +16086,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16089,7 +16189,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16206,7 +16306,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16321,7 +16421,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16482,7 +16582,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16640,7 +16740,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -16745,7 +16845,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16848,7 +16948,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16953,7 +17053,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17056,7 +17156,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17161,7 +17261,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17264,7 +17364,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17369,7 +17469,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17461,7 +17561,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -17472,7 +17572,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -17531,7 +17631,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17595,7 +17695,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -17671,7 +17771,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -17747,7 +17847,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17822,7 +17922,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17903,7 +18003,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17914,7 +18014,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17965,7 +18065,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17976,7 +18076,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18059,7 +18159,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18123,7 +18223,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -18199,7 +18299,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -18282,7 +18382,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -18363,7 +18463,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -18374,7 +18474,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -18441,7 +18541,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -18516,7 +18616,7 @@ }, "x-appwrite": { "method": "list", - "weight": 337, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18545,7 +18645,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "type": "array", "collectionFormat": "multi", @@ -18591,7 +18691,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18687,7 +18787,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 339, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18777,7 +18877,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 334, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18859,7 +18959,7 @@ }, "x-appwrite": { "method": "deleteFirebaseAuth", - "weight": 345, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18911,7 +19011,7 @@ }, "x-appwrite": { "method": "createFirebaseOAuthMigration", - "weight": 333, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18993,7 +19093,7 @@ }, "x-appwrite": { "method": "listFirebaseProjects", - "weight": 344, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19045,7 +19145,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 340, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -19118,7 +19218,7 @@ }, "x-appwrite": { "method": "getFirebaseReportOAuth", - "weight": 341, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19191,7 +19291,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 336, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -19314,7 +19414,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 347, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -19436,7 +19536,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 335, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -19552,7 +19652,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 346, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -19667,7 +19767,7 @@ }, "x-appwrite": { "method": "get", - "weight": 338, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -19727,7 +19827,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 348, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -19782,7 +19882,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 349, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -19844,7 +19944,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -19930,7 +20030,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19980,7 +20080,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -20059,7 +20159,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -20119,7 +20219,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -20198,7 +20298,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -20260,7 +20360,7 @@ }, "x-appwrite": { "method": "list", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -20333,7 +20433,7 @@ }, "x-appwrite": { "method": "create", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -20485,7 +20585,7 @@ }, "x-appwrite": { "method": "get", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -20545,7 +20645,7 @@ }, "x-appwrite": { "method": "update", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20672,7 +20772,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20734,7 +20834,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20828,7 +20928,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20908,7 +21008,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20988,7 +21088,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -21068,7 +21168,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -21148,7 +21248,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -21231,7 +21331,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21311,7 +21411,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -21391,7 +21491,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21471,7 +21571,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21551,7 +21651,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -21650,7 +21750,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21739,7 +21839,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -21799,7 +21899,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -21895,7 +21995,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21963,7 +22063,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -22060,7 +22160,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -22130,7 +22230,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -22271,7 +22371,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22331,7 +22431,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -22455,7 +22555,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22523,7 +22623,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22622,7 +22722,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22692,7 +22792,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22794,7 +22894,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22874,7 +22974,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -23003,7 +23103,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -23143,7 +23243,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 153, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -23223,7 +23323,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23445,7 +23545,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23710,7 +23810,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23934,7 +24034,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -24153,7 +24253,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -24390,7 +24490,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -24611,7 +24711,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24671,7 +24771,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -24793,7 +24893,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24861,7 +24961,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24984,7 +25084,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -25054,7 +25154,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -25124,7 +25224,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -25197,7 +25297,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -25288,7 +25388,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -25343,7 +25443,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -25405,7 +25505,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -25467,7 +25567,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25541,7 +25641,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25682,7 +25782,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25743,7 +25843,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25878,7 +25978,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25941,7 +26041,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -26015,7 +26115,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -26026,7 +26126,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -26120,7 +26220,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -26192,7 +26292,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -26283,7 +26383,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -26357,7 +26457,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -26431,7 +26531,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -26632,7 +26732,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26706,7 +26806,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 214, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -26780,7 +26880,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 215, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26862,7 +26962,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26939,7 +27039,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -27033,7 +27133,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -27097,7 +27197,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27174,7 +27274,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27240,7 +27340,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27314,7 +27414,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -27388,7 +27488,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -27399,7 +27499,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27516,7 +27616,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27577,7 +27677,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -27588,7 +27688,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27676,7 +27776,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27739,7 +27839,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -27750,7 +27850,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27847,7 +27947,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27909,7 +28009,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27991,7 +28091,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -28065,7 +28165,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -28162,7 +28262,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -28255,7 +28355,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -28348,7 +28448,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28419,7 +28519,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28482,7 +28582,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28575,7 +28675,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28668,7 +28768,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28796,7 +28896,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28910,7 +29010,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -29024,7 +29124,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -29098,7 +29198,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -29154,7 +29254,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29217,7 +29317,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29298,7 +29398,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -29371,7 +29471,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -29382,7 +29482,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29466,7 +29566,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29541,7 +29641,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29604,7 +29704,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29685,7 +29785,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29761,7 +29861,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29824,7 +29924,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29885,7 +29985,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29946,7 +30046,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -30009,7 +30109,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30090,7 +30190,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30171,7 +30271,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -30252,7 +30352,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -30313,7 +30413,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30394,7 +30494,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30444,7 +30544,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -30455,7 +30555,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -30511,7 +30611,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30569,7 +30669,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30640,7 +30740,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30721,7 +30821,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30795,7 +30895,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30910,7 +31010,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30980,7 +31080,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -31074,7 +31174,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -31135,7 +31235,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -31146,7 +31246,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -31230,7 +31330,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -31311,7 +31411,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -31392,7 +31492,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -31461,7 +31561,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -31548,7 +31648,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 279, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -31618,7 +31718,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 280, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -31688,7 +31788,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -31767,7 +31867,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31847,7 +31947,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -31935,7 +32035,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -32010,7 +32110,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -32065,7 +32165,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -35564,7 +35664,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -36238,7 +36338,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -36569,6 +36669,17 @@ "description": "SMTP server secure protocol", "x-example": "tls" }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -36696,6 +36807,8 @@ "smtpUsername", "smtpPassword", "smtpSecure", + "pingCount", + "pingedAt", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -38303,7 +38416,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38944,7 +39057,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38966,6 +39079,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38975,7 +39093,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -38989,7 +39108,7 @@ }, "$createdAt": { "type": "string", - "description": "Variable creation date in ISO 8601 format.", + "description": "Migration creation date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$updatedAt": { @@ -39012,9 +39131,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -39050,6 +39174,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 80c9e6037f..f4e3fa3f95 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -102,7 +102,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -156,7 +156,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -238,7 +238,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -249,7 +249,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -332,7 +332,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -397,7 +397,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -463,7 +463,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -516,7 +516,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -586,7 +586,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -662,7 +662,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -731,7 +731,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -813,7 +813,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -884,7 +884,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -958,7 +958,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -1041,7 +1041,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1097,7 +1097,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1151,7 +1151,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1205,7 +1205,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1261,7 +1261,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1337,7 +1337,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1419,7 +1419,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1502,7 +1502,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1556,7 +1556,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1632,7 +1632,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1705,7 +1705,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1716,7 +1716,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1806,7 +1806,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1855,7 +1855,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1911,7 +1911,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1953,7 +1953,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1964,7 +1964,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -2044,7 +2044,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2124,7 +2124,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2204,7 +2204,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2284,7 +2284,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2348,7 +2348,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2407,7 +2407,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2473,7 +2473,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2518,7 +2518,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2529,7 +2529,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2604,7 +2604,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2615,7 +2615,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2699,7 +2699,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -2707,7 +2707,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2834,7 +2834,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2845,7 +2845,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -2917,7 +2917,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -2928,7 +2928,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3002,7 +3002,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3085,7 +3085,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3142,7 +3142,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3214,7 +3214,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3225,7 +3225,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3345,7 +3345,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3356,7 +3356,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3480,7 +3480,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3491,7 +3491,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3549,7 +3549,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3560,7 +3560,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -4042,7 +4042,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4053,7 +4053,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4131,7 +4131,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4142,7 +4142,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4228,7 +4228,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4239,7 +4239,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4336,7 +4336,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4400,7 +4400,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4411,7 +4411,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4498,7 +4498,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4560,7 +4560,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4641,7 +4641,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -4705,7 +4705,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -4788,7 +4788,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -4898,7 +4898,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -4968,7 +4968,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -5072,7 +5072,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5144,7 +5144,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5217,7 +5217,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5228,7 +5228,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5335,7 +5335,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5446,7 +5446,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5553,7 +5553,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5653,7 +5653,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5664,7 +5664,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -5760,7 +5760,7 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -5771,7 +5771,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -5871,7 +5871,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5882,7 +5882,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -5988,7 +5988,7 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -5999,7 +5999,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6109,7 +6109,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6120,7 +6120,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6228,7 +6228,7 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6239,7 +6239,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6353,7 +6353,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6364,7 +6364,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6472,7 +6472,7 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6483,7 +6483,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6597,7 +6597,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6608,7 +6608,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -6704,7 +6704,7 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -6715,7 +6715,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -6815,7 +6815,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -6826,7 +6826,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -6951,7 +6951,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -6962,7 +6962,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -7071,7 +7071,7 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -7082,7 +7082,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7157,7 +7157,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7188,7 +7188,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7199,7 +7199,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7295,7 +7295,7 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7306,7 +7306,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7448,7 +7448,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7520,7 +7520,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7586,7 +7586,7 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -7597,7 +7597,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -7704,7 +7704,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -7790,7 +7790,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -7874,6 +7874,96 @@ } } ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7900,7 +7990,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -7994,7 +8084,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8095,7 +8185,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8179,7 +8269,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8250,7 +8340,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8261,7 +8351,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8384,7 +8474,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8456,7 +8546,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8535,7 +8625,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8610,7 +8700,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8669,6 +8759,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8687,6 +8778,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8694,24 +8787,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -8836,7 +8935,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -8874,7 +8973,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8917,7 +9016,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -8928,7 +9027,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8983,7 +9082,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9045,7 +9144,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9106,6 +9205,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9124,6 +9224,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9131,24 +9233,30 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1" ], "x-enum-name": null, "x-enum-keys": [] @@ -9250,7 +9358,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9279,7 +9387,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9343,7 +9451,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9415,7 +9523,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9426,7 +9534,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9521,7 +9629,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9591,7 +9699,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9656,7 +9764,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9723,7 +9831,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9808,7 +9916,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9880,7 +9988,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9954,7 +10062,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10022,7 +10130,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -10041,7 +10149,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10083,65 +10191,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -10170,7 +10272,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10231,7 +10333,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -10239,7 +10341,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10311,7 +10413,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10373,7 +10475,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10462,7 +10564,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10532,7 +10634,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10621,7 +10723,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10693,7 +10795,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10771,7 +10873,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10849,7 +10951,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -10903,7 +11005,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -10957,7 +11059,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11011,7 +11113,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11074,7 +11176,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11128,7 +11230,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11182,7 +11284,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11236,7 +11338,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11301,7 +11403,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11366,7 +11468,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11440,7 +11542,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11494,7 +11596,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -11505,7 +11607,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11594,7 +11696,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11659,7 +11761,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11724,7 +11826,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11789,7 +11891,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11854,7 +11956,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11919,7 +12021,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11984,7 +12086,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12049,7 +12151,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12114,7 +12216,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12168,7 +12270,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12222,7 +12324,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12265,7 +12367,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -12276,7 +12378,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12334,7 +12436,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12392,7 +12494,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12450,7 +12552,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12508,7 +12610,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12566,7 +12668,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12624,7 +12726,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12682,7 +12784,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12740,7 +12842,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12818,7 +12920,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -12968,7 +13070,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -12979,7 +13081,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -13137,7 +13239,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13302,7 +13404,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13313,7 +13415,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -13486,7 +13588,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13596,7 +13698,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13607,7 +13709,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -13715,7 +13817,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13726,7 +13828,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13786,7 +13888,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -13851,7 +13953,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13928,7 +14030,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14005,7 +14107,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14083,7 +14185,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14201,7 +14303,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -14317,7 +14419,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14411,7 +14513,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -14503,7 +14605,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -14633,7 +14735,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14761,7 +14863,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14867,7 +14969,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14971,7 +15073,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15089,7 +15191,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15205,7 +15307,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15367,7 +15469,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15526,7 +15628,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15632,7 +15734,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15736,7 +15838,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15842,7 +15944,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15946,7 +16048,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16052,7 +16154,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16156,7 +16258,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16262,7 +16364,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16355,7 +16457,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -16366,7 +16468,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16426,7 +16528,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16491,7 +16593,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16568,7 +16670,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -16645,7 +16747,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16721,7 +16823,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16803,7 +16905,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16814,7 +16916,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16866,7 +16968,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16877,7 +16979,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16961,7 +17063,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17026,7 +17128,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17103,7 +17205,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -17187,7 +17289,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17270,7 +17372,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -17281,7 +17383,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -17349,7 +17451,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -17426,7 +17528,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17501,7 +17603,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17643,7 +17745,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17705,7 +17807,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17841,7 +17943,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17905,7 +18007,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17981,7 +18083,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -17992,7 +18094,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -18088,7 +18190,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -18162,7 +18264,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -18255,7 +18357,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -18331,7 +18433,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18407,7 +18509,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -18610,7 +18712,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18686,7 +18788,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18765,7 +18867,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18861,7 +18963,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18927,7 +19029,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -19006,7 +19108,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19074,7 +19176,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -19150,7 +19252,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -19161,7 +19263,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19280,7 +19382,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -19343,7 +19445,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -19354,7 +19456,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19444,7 +19546,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19509,7 +19611,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -19520,7 +19622,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19619,7 +19721,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19683,7 +19785,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19767,7 +19869,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19842,7 +19944,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19940,7 +20042,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -20034,7 +20136,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -20128,7 +20230,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20200,7 +20302,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20264,7 +20366,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -20358,7 +20460,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20452,7 +20554,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20581,7 +20683,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20696,7 +20798,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20811,7 +20913,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20868,7 +20970,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20932,7 +21034,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21014,7 +21116,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -21088,7 +21190,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -21099,7 +21201,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21184,7 +21286,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21260,7 +21362,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21324,7 +21426,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21406,7 +21508,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21483,7 +21585,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21547,7 +21649,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21609,7 +21711,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21671,7 +21773,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21735,7 +21837,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21817,7 +21919,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21899,7 +22001,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21981,7 +22083,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -22043,7 +22145,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22125,7 +22227,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22176,7 +22278,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -22187,7 +22289,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -22244,7 +22346,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22303,7 +22405,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22375,7 +22477,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -22457,7 +22559,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -22532,7 +22634,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22648,7 +22750,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22719,7 +22821,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22814,7 +22916,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22876,7 +22978,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -22887,7 +22989,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22972,7 +23074,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23054,7 +23156,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -26273,7 +26375,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -26591,7 +26693,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -27087,7 +27189,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27538,7 +27640,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27560,6 +27662,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27569,7 +27676,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/docs/references/databases/delete-documents.md b/docs/references/databases/delete-documents.md new file mode 100644 index 0000000000..a7b05503de --- /dev/null +++ b/docs/references/databases/delete-documents.md @@ -0,0 +1 @@ +Bulk delete documents using queries, if no queries are passed then all documents are deleted. \ No newline at end of file From 95861d068d909d3322d5d055785f8541da72dbaf Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 7 Nov 2024 13:14:15 +0900 Subject: [PATCH 003/161] Fix Tests --- tests/e2e/Services/Databases/DatabasesBase.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 567facc54f..12f82c9a7f 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1514,12 +1514,6 @@ trait DatabasesBase $this->assertEquals(400, $document4['headers']['status-code']); - // Delete document 4 with incomplete path - $this->assertEquals(404, $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()))['headers']['status-code']); - return $data; } @@ -5075,7 +5069,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(1000, $documents['body']['total']); + $this->assertEquals(1001, $documents['body']['total']); $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5083,7 +5077,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1000, $response['body']['modified']); + $this->assertEquals(1001, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', From 8a601ee058b724cfeb69e8d467265c2499cca0a0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 7 Nov 2024 14:41:14 +0900 Subject: [PATCH 004/161] Update src/Appwrite/Utopia/Response/Model/BulkOperation.php Co-authored-by: Jake Barnby --- src/Appwrite/Utopia/Response/Model/BulkOperation.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php index 15bc8f25f7..7c6d7f6fe9 100644 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -16,7 +16,6 @@ class BulkOperation extends Model 'default' => 0, 'example' => 64, ]); - } /** From 5bf20289a5c8ed5f2a9148fe6651b92ac0d00794 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 8 Nov 2024 16:17:29 +0900 Subject: [PATCH 005/161] Address Comments --- .env | 1 + app/controllers/api/databases.php | 26 +- .../e2e/Services/Databases/DatabasesBase.php | 353 ++++++++++++++++++ .../Databases/DatabasesCustomClientTest.php | 121 ++++++ 4 files changed, 484 insertions(+), 17 deletions(-) diff --git a/.env b/.env index f6a6a7f642..a20cd49835 100644 --- a/.env +++ b/.env @@ -32,6 +32,7 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword +_APP_DATABASE_BATCH_SIZE=10_000 _APP_STORAGE_DEVICE=Local _APP_STORAGE_S3_ACCESS_KEY= _APP_STORAGE_S3_SECRET= diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 9e64ca96de..b76229e725 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -46,6 +46,7 @@ use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\Structure; use Utopia\Database\Validator\UID; use Utopia\Locale\Locale; +use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\FloatValidator; @@ -3853,24 +3854,15 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); - var_dump($queries); - - try { - $modified = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { - return $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries - ); - }); - } catch (NotFoundException $e) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } + $modified = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { + return $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries, + intval(System::getEnv('_APP_DATABASE_BATCH_SIZE', 10_000)) + ); + }); return $response->dynamic(new Document([ 'modified' => $modified, diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 12f82c9a7f..9895e8b9ba 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4792,6 +4792,12 @@ trait DatabasesBase ]); $this->assertEquals(408, $response['headers']['status-code']); + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); } public function testBulkDeletes(): void @@ -5093,4 +5099,351 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); } + + public function testBulkDeletesRelationshipRestrict() + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection1', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection2', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection1 = $collection1['body']['$id']; + $collection2 = $collection2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_RESTRICT, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + sleep(3); + + $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Document 1', + 'collection2' => [ + [ + 'name' => 'Document 2', + ], + ], + ], + ]); + + $this->assertEquals(201, $document1['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(403, $response['headers']['status-code']); + $this->assertEquals('document_delete_restricted', $response['body']['type']); + } + + public function testBulkDeletesRelationshipNull() + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection1', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection2', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection1 = $collection1['body']['$id']; + $collection2 = $collection2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_SET_NULL, + 'twoWay' => true, + 'twoWayKey' => 'collection1', + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + sleep(3); + + $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Document 1', + 'collection2' => [ + [ + 'name' => 'Document 2', + ], + ], + ], + ]); + + $this->assertEquals(201, $document1['headers']['status-code']); + + $document2 = $document1['body']['collection2'][0]['$id']; + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + + $document2 = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents/' . $document2, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $document2['headers']['status-code']); + $this->assertEmpty($document2['body']['collection1']); + } + + public function testBulkDeletesRelationshipCascade() + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection1', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection2', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection1 = $collection1['body']['$id']; + $collection2 = $collection2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_ONE, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_CASCADE + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + sleep(3); + + for ($i = 0; $i < 5; $i++) { + $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Document 1', + 'collection2' => [ + 'name' => 'Document 2', + ], + ], + ]); + + $this->assertEquals(201, $document1['headers']['status-code']); + } + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + + $collection1docs = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $collection1docs['headers']['status-code']); + $this->assertEquals(0, $collection1docs['body']['total']); + + $collection2docs = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $collection2docs['headers']['status-code']); + $this->assertEquals(0, $collection2docs['body']['total']); + } } diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 8484996058..57cd5115c9 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -890,4 +890,125 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); } + + public function testBulkDeletesPermissions(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes Perms' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Deletes Perms', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])) + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + sleep(2); + + // TEST: Delete all documents with invalid collection level permissions + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(401, $response['headers']['status-code']); + + $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Bulk Deletes Perms', + 'documentSecurity' => true + ]); + + $this->assertEquals(200, $collection['headers']['status-code']); + + // TEST: Make sure we can delete only documents we have permissions for + for ($i = 0; $i < 6; $i++) { + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => $i, + ], + 'permissions' => [ + Permission::delete(Role::user($this->getUser()['$id'])) + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + } + + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => 6, + ], + 'permissions' => [ + Permission::delete(Role::user('user2')) + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(1, $documents['body']['total']); + } } From 2a8ab8d610a3e5c80b540a4f729cdfc089aeaf01 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 11 Nov 2024 12:36:58 +0900 Subject: [PATCH 006/161] Add base bulk operation models and envvars --- .env | 1 + src/Appwrite/Utopia/Response.php | 3 ++ .../Utopia/Response/Model/BulkOperation.php | 40 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/.env b/.env index 8ff8164a21..281c6a825f 100644 --- a/.env +++ b/.env @@ -33,6 +33,7 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword +_APP_DATABASE_BATCH_SIZE=10_000 _APP_STORAGE_DEVICE=Local _APP_STORAGE_S3_ACCESS_KEY= _APP_STORAGE_S3_SECRET= diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 6cc2639f51..53aa2389ed 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -31,6 +31,7 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; +use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -151,6 +152,7 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; + public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; @@ -482,6 +484,7 @@ class Response extends SwooleResponse ->setModel(new Migration()) ->setModel(new MigrationReport()) ->setModel(new MigrationFirebaseProject()) + ->setModel(new BulkOperation()) // Tests (keep last) ->setModel(new Mock()); diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php new file mode 100644 index 0000000000..5747645fb1 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -0,0 +1,40 @@ +addRule('modified', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of documents affected by the operation.', + 'default' => 0, + 'example' => 64, + ]); + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'BulkOperation'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_BULK_OPERATION; + } +} \ No newline at end of file From 60da24e5213394022bd2531d6c699bea7053b7f5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 11 Nov 2024 03:58:24 +0000 Subject: [PATCH 007/161] Run Linter --- src/Appwrite/Utopia/Response/Model/BulkOperation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php index 5747645fb1..7c6d7f6fe9 100644 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -37,4 +37,4 @@ class BulkOperation extends Model { return Response::MODEL_BULK_OPERATION; } -} \ No newline at end of file +} From 44234da9950daebcad557dffab151332685867e4 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 11 Nov 2024 15:27:26 +0900 Subject: [PATCH 008/161] Implement Bulk Updates API --- app/controllers/api/databases.php | 117 +++++++ composer.json | 2 +- composer.lock | 14 +- docs/references/databases/update-documents.md | 1 + .../e2e/Services/Databases/DatabasesBase.php | 164 ++++++++++ .../Databases/DatabasesCustomClientTest.php | 285 ++++++++++++++++++ 6 files changed, 575 insertions(+), 8 deletions(-) create mode 100644 docs/references/databases/update-documents.md diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 0114fd343c..5c3baf3b63 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3688,6 +3688,123 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->setPayload($response->getPayload(), sensitive: $relationships); }); +App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') + ->alias('/v1/database/collections/:collectionId/documents') + ->desc('Update documents') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.update') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.update') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') + ->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.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'databases') + ->label('sdk.method', 'updateDocuments') + ->label('sdk.description', '/docs/references/databases/update-documents.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) + ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) + ->inject('requestTimestamp') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('mode') + ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, string $mode) { + $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + + if (empty($data) && \is_null($permissions)) { + throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); + } + + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + + if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions, [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]); + + // Users can only manage their own roles, API keys and Admin users can manage any + $roles = Authorization::getRoles(); + if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); + } + } + } + } + + $partialDocument = new Document($data); + + try { + $modified = $dbForProject->withRequestTimestamp( + $requestTimestamp, + fn () => $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $partialDocument, + $queries + ) + ); + } catch (AuthorizationException) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } catch (NotFoundException $e) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + $response->dynamic(new Document([ + 'modified' => $modified + ]), Response::MODEL_BULK_OPERATION); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setContext('collection', $collection) + ->setContext('database', $database) + ->setPayload($response->getPayload()); + }); + App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) ->desc('Delete document') diff --git a/composer.json b/composer.json index a04ca51d43..237e2e9562 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.16", + "utopia-php/database": "0.53.17", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 691a7e740e..5a61332b2a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b358198535c1867eabed7c0f99135a57", + "content-hash": "971e88c7387ffd92d755772e0f4e7805", "packages": [ { "name": "adhocore/jwt", @@ -1770,16 +1770,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.16", + "version": "0.53.17", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "6661edffeef05b59e16d102b989a72f7f78cf7de" + "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/6661edffeef05b59e16d102b989a72f7f78cf7de", - "reference": "6661edffeef05b59e16d102b989a72f7f78cf7de", + "url": "https://api.github.com/repos/utopia-php/database/zipball/07e3e5a1f5dbf9b351aab138085bde06611b305a", + "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a", "shasum": "" }, "require": { @@ -1820,9 +1820,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.16" + "source": "https://github.com/utopia-php/database/tree/0.53.17" }, - "time": "2024-11-06T03:07:16+00:00" + "time": "2024-11-06T09:20:59+00:00" }, { "name": "utopia-php/domains", diff --git a/docs/references/databases/update-documents.md b/docs/references/databases/update-documents.md new file mode 100644 index 0000000000..f04ec420f8 --- /dev/null +++ b/docs/references/databases/update-documents.md @@ -0,0 +1 @@ +Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated. \ No newline at end of file diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index d079cb313c..6cb162e8f1 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4799,4 +4799,168 @@ trait DatabasesBase $this->assertEquals(408, $response['headers']['status-code']); } + + public function testBulkUpdates(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Updates' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Updates', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + for ($x = 1; $x <= $amount; $x++) { + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => $x, + ], + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + } + }; + + $createBulkDocuments(); + + // TEST: Update all documents + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100 + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(10, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [100])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + if ($this->getSide() === 'client') { + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + } + } + + // TEST: Update documents with query + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 200 + ], + 'queries' => [ + Query::limit(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [200])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(5, $documents['body']['total']); + + // TEST: Update documents with offset + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 200 + ], + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [200])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + } } diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 8484996058..934ba92a3e 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -10,6 +10,7 @@ use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; class DatabasesCustomClientTest extends Scope { @@ -890,4 +891,288 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); } + + public function testBulkUpdatesPermissions(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Update Perms' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Updates Perms', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])) + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + sleep(2); + + // TEST: Update all documents with invalid collection level permissions + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100 + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Bulk Updates Perms', + 'documentSecurity' => true + ]); + + $this->assertEquals(200, $collection['headers']['status-code']); + + // TEST: Make sure we can update only documents we have permissions for + for ($i = 0; $i < 6; $i++) { + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => $i, + ], + 'permissions' => [ + Permission::update(Role::user($this->getUser()['$id'])) + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + } + + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'number' => 6, + ], + 'permissions' => [ + Permission::update(Role::user('user2')) + ] + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100 + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'queries' => [Query::notEqual('number', 100)->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(1, $documents['body']['total']); + } + + public function testBulkUpdatesRelationship() + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Updates' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection1', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection1['headers']['status-code']); + + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection2', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection1['headers']['status-code']); + + $collection1 = $collection1['body']['$id']; + $collection2 = $collection2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_RESTRICT, + 'twoWay' => true, + 'twoWayKey' => 'collection1', + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + sleep(3); + + $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Document 1', + 'collection2' => [ + [ + 'name' => 'Document 2', + ], + ], + ], + ]); + + $this->assertEquals(201, $document1['headers']['status-code']); + $document1 = $document1['body']['$id']; + + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Document 1 Updated', + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['modified']); + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + + $document2 = $response['body']['documents'][0]; + + $this->assertEquals('Document 2', $document2['name']); + $this->assertEquals('Document 1 Updated', $document2['collection1']['name']); + + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Document 2 Updated', + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents/' . $document1, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('Document 1 Updated', $response['body']['name']); + + $document2 = $response['body']['collection2'][0]; + $this->assertEquals('Document 2 Updated', $document2['name']); + } } From 07738bdcf9010c0ce33df888bbe02fb95b7a2e51 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 11 Nov 2024 15:29:59 +0900 Subject: [PATCH 009/161] Update Specs --- app/config/specs/open-api3-latest-client.json | 180 ++++- .../specs/open-api3-latest-console.json | 656 ++++++++++-------- app/config/specs/open-api3-latest-server.json | 452 +++++++----- app/config/specs/swagger2-latest-client.json | 179 ++++- app/config/specs/swagger2-latest-console.json | 655 +++++++++-------- app/config/specs/swagger2-latest-server.json | 451 +++++++----- 6 files changed, 1605 insertions(+), 968 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index e3cd909b4e..aaf713b5c5 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4637,6 +4637,112 @@ } } } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -4859,7 +4965,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -4945,7 +5051,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5033,7 +5139,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5150,7 +5256,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5226,7 +5332,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5280,7 +5386,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5334,7 +5440,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5388,7 +5494,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5442,7 +5548,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5496,7 +5602,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5550,7 +5656,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5604,7 +5710,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5658,7 +5764,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5712,7 +5818,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5766,7 +5872,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -5851,7 +5957,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -5928,7 +6034,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6016,7 +6122,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -6116,7 +6222,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6190,7 +6296,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6281,7 +6387,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6350,7 +6456,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6419,7 +6525,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6637,7 +6743,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6713,7 +6819,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6791,7 +6897,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6878,7 +6984,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6942,7 +7048,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7018,7 +7124,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7084,7 +7190,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7172,7 +7278,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7285,7 +7391,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7359,7 +7465,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7448,7 +7554,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7524,7 +7630,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7624,7 +7730,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7687,7 +7793,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 4e97fecc30..87a9b7ac7f 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -4465,7 +4465,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4534,7 +4534,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4740,7 +4740,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8206,6 +8206,112 @@ } } } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -8428,7 +8534,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -9055,7 +9161,7 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -9224,7 +9330,7 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -9308,7 +9414,7 @@ }, "x-appwrite": { "method": "list", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9383,7 +9489,7 @@ }, "x-appwrite": { "method": "create", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9631,7 +9737,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9682,7 +9788,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9734,7 +9840,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9836,7 +9942,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9898,7 +10004,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9972,7 +10078,7 @@ }, "x-appwrite": { "method": "get", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -10033,7 +10139,7 @@ }, "x-appwrite": { "method": "update", - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10258,7 +10364,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10321,7 +10427,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10406,7 +10512,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 299, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10504,7 +10610,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10575,7 +10681,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10639,7 +10745,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10705,7 +10811,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10792,7 +10898,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10858,7 +10964,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 296, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -10933,7 +11039,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11021,7 +11127,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11138,7 +11244,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11205,7 +11311,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11278,7 +11384,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11362,7 +11468,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11423,7 +11529,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11511,7 +11617,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11582,7 +11688,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11670,7 +11776,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11743,7 +11849,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11797,7 +11903,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11851,7 +11957,7 @@ }, "x-appwrite": { "method": "get", - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -11902,7 +12008,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11953,7 +12059,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12004,7 +12110,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12066,7 +12172,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12117,7 +12223,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12168,7 +12274,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12219,7 +12325,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12283,7 +12389,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12347,7 +12453,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12422,7 +12528,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12486,7 +12592,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12576,7 +12682,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12640,7 +12746,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12704,7 +12810,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12768,7 +12874,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12832,7 +12938,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12896,7 +13002,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12960,7 +13066,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13024,7 +13130,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13088,7 +13194,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13139,7 +13245,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13190,7 +13296,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13241,7 +13347,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13295,7 +13401,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13349,7 +13455,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13403,7 +13509,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13457,7 +13563,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13511,7 +13617,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13565,7 +13671,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13619,7 +13725,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13673,7 +13779,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13751,7 +13857,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13897,7 +14003,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -14045,7 +14151,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14202,7 +14308,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -14361,7 +14467,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14472,7 +14578,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -14586,7 +14692,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -14641,7 +14747,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -14705,7 +14811,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14782,7 +14888,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14859,7 +14965,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14937,7 +15043,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15044,7 +15150,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -15154,7 +15260,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15241,7 +15347,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -15331,7 +15437,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15448,7 +15554,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15568,7 +15674,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15665,7 +15771,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15765,7 +15871,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15872,7 +15978,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15982,7 +16088,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16127,7 +16233,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16274,7 +16380,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16371,7 +16477,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16471,7 +16577,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16568,7 +16674,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16668,7 +16774,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16765,7 +16871,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16865,7 +16971,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16962,7 +17068,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17062,7 +17168,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -17117,7 +17223,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17181,7 +17287,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -17258,7 +17364,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -17335,7 +17441,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17411,7 +17517,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17496,7 +17602,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17558,7 +17664,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17637,7 +17743,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17701,7 +17807,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17778,7 +17884,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -17864,7 +17970,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -17956,7 +18062,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -18021,7 +18127,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -18098,7 +18204,7 @@ }, "x-appwrite": { "method": "list", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18174,7 +18280,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18264,7 +18370,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18359,7 +18465,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18430,7 +18536,7 @@ }, "x-appwrite": { "method": "deleteFirebaseAuth", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -18480,7 +18586,7 @@ }, "x-appwrite": { "method": "createFirebaseOAuthMigration", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18558,7 +18664,7 @@ }, "x-appwrite": { "method": "listFirebaseProjects", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18608,7 +18714,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18682,7 +18788,7 @@ }, "x-appwrite": { "method": "getFirebaseReportOAuth", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18756,7 +18862,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18869,7 +18975,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -19004,7 +19110,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -19111,7 +19217,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -19237,7 +19343,7 @@ }, "x-appwrite": { "method": "get", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -19297,7 +19403,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -19350,7 +19456,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -19412,7 +19518,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19502,7 +19608,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19550,7 +19656,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19625,7 +19731,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19685,7 +19791,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19762,7 +19868,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19824,7 +19930,7 @@ }, "x-appwrite": { "method": "list", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19898,7 +20004,7 @@ }, "x-appwrite": { "method": "create", - "weight": 150, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -20035,7 +20141,7 @@ }, "x-appwrite": { "method": "get", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -20095,7 +20201,7 @@ }, "x-appwrite": { "method": "update", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20212,7 +20318,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20274,7 +20380,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20368,7 +20474,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20449,7 +20555,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20530,7 +20636,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20611,7 +20717,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20672,7 +20778,7 @@ }, "\/projects\/{projectId}\/auth\/memberships-privacy": { "patch": { - "summary": "Update project team sensitive attributes", + "summary": "Update project memberships privacy attributes", "operationId": "projectsUpdateMembershipsPrivacy", "tags": [ "projects" @@ -20692,7 +20798,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20785,7 +20891,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20869,7 +20975,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20950,7 +21056,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21031,7 +21137,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -21112,7 +21218,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21193,7 +21299,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -21295,7 +21401,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21384,7 +21490,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21444,7 +21550,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -21539,7 +21645,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21609,7 +21715,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21705,7 +21811,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21777,7 +21883,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21916,7 +22022,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21976,7 +22082,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22097,7 +22203,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22167,7 +22273,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22264,7 +22370,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22336,7 +22442,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22438,7 +22544,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22519,7 +22625,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22639,7 +22745,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22772,7 +22878,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22853,7 +22959,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23079,7 +23185,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23345,7 +23451,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23573,7 +23679,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23796,7 +23902,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -24038,7 +24144,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -24263,7 +24369,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24323,7 +24429,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24440,7 +24546,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24510,7 +24616,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24628,7 +24734,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24700,7 +24806,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24772,7 +24878,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24846,7 +24952,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24932,7 +25038,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24985,7 +25091,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -25047,7 +25153,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -25109,7 +25215,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25184,7 +25290,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25313,7 +25419,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25374,7 +25480,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25500,7 +25606,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -25563,7 +25669,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25651,7 +25757,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -25751,7 +25857,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25825,7 +25931,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25916,7 +26022,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25985,7 +26091,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26054,7 +26160,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -26272,7 +26378,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -26348,7 +26454,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26422,7 +26528,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26506,7 +26612,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26584,7 +26690,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26671,7 +26777,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -26735,7 +26841,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -26811,7 +26917,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26877,7 +26983,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26952,7 +27058,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27040,7 +27146,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -27153,7 +27259,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27227,7 +27333,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27316,7 +27422,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27392,7 +27498,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27491,7 +27597,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27553,7 +27659,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27636,7 +27742,7 @@ }, "x-appwrite": { "method": "list", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -27711,7 +27817,7 @@ }, "x-appwrite": { "method": "create", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27801,7 +27907,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27888,7 +27994,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27975,7 +28081,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -28045,7 +28151,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -28108,7 +28214,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -28195,7 +28301,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28282,7 +28388,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28399,7 +28505,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -28504,7 +28610,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28611,7 +28717,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28685,7 +28791,7 @@ }, "x-appwrite": { "method": "get", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -28739,7 +28845,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -28802,7 +28908,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -28884,7 +28990,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28968,7 +29074,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29053,7 +29159,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -29129,7 +29235,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29192,7 +29298,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29274,7 +29380,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29352,7 +29458,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29415,7 +29521,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29476,7 +29582,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29537,7 +29643,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29600,7 +29706,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29682,7 +29788,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29764,7 +29870,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -29846,7 +29952,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -29907,7 +30013,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -29989,7 +30095,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -30050,7 +30156,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -30104,7 +30210,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -30160,7 +30266,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30233,7 +30339,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -30315,7 +30421,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -30390,7 +30496,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -30502,7 +30608,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30574,7 +30680,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -30665,7 +30771,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -30739,7 +30845,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30823,7 +30929,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30905,7 +31011,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30987,7 +31093,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -31058,7 +31164,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -31145,7 +31251,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -31217,7 +31323,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -31289,7 +31395,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 277, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31372,7 +31478,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -31453,7 +31559,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -31544,7 +31650,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 284, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31620,7 +31726,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31673,7 +31779,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -36077,17 +36183,17 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, - "membershipsUserName": { + "authMembershipsUserName": { "type": "boolean", "description": "Whether or not to show user names in the teams membership response.", "x-example": true }, - "membershipsUserEmail": { + "authMembershipsUserEmail": { "type": "boolean", "description": "Whether or not to show user emails in the teams membership response.", "x-example": true }, - "membershipsMfa": { + "authMembershipsMfa": { "type": "boolean", "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true @@ -36297,9 +36403,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", - "membershipsUserName", - "membershipsUserEmail", - "membershipsMfa", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index e84b751743..08d58bc9b9 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7735,6 +7735,114 @@ } } } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7961,7 +8069,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -8414,7 +8522,7 @@ }, "x-appwrite": { "method": "list", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8490,7 +8598,7 @@ }, "x-appwrite": { "method": "create", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8739,7 +8847,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8791,7 +8899,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8844,7 +8952,7 @@ }, "x-appwrite": { "method": "get", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8906,7 +9014,7 @@ }, "x-appwrite": { "method": "update", - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9132,7 +9240,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9196,7 +9304,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9282,7 +9390,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 299, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9381,7 +9489,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9453,7 +9561,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9518,7 +9626,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9585,7 +9693,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9673,7 +9781,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9740,7 +9848,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 296, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9816,7 +9924,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -9906,7 +10014,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10025,7 +10133,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10094,7 +10202,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10168,7 +10276,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10230,7 +10338,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10319,7 +10427,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10391,7 +10499,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10480,7 +10588,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10554,7 +10662,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10610,7 +10718,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10666,7 +10774,7 @@ }, "x-appwrite": { "method": "get", - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -10718,7 +10826,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -10770,7 +10878,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -10822,7 +10930,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -10885,7 +10993,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10937,7 +11045,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10989,7 +11097,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11041,7 +11149,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11106,7 +11214,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11171,7 +11279,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11247,7 +11355,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11312,7 +11420,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11403,7 +11511,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11468,7 +11576,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11533,7 +11641,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11598,7 +11706,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11663,7 +11771,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11728,7 +11836,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11793,7 +11901,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11858,7 +11966,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11923,7 +12031,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11975,7 +12083,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12027,7 +12135,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12079,7 +12187,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12135,7 +12243,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12191,7 +12299,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12247,7 +12355,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12303,7 +12411,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12359,7 +12467,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12415,7 +12523,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12471,7 +12579,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12527,7 +12635,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -12606,7 +12714,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -12753,7 +12861,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -12902,7 +13010,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13060,7 +13168,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -13220,7 +13328,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13332,7 +13440,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -13447,7 +13555,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -13503,7 +13611,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -13568,7 +13676,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13646,7 +13754,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13724,7 +13832,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -13803,7 +13911,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13911,7 +14019,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -14022,7 +14130,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14110,7 +14218,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -14201,7 +14309,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -14319,7 +14427,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14440,7 +14548,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14538,7 +14646,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14639,7 +14747,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14747,7 +14855,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14858,7 +14966,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15004,7 +15112,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15152,7 +15260,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15250,7 +15358,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15351,7 +15459,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15449,7 +15557,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15550,7 +15658,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15648,7 +15756,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -15749,7 +15857,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15847,7 +15955,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -15948,7 +16056,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16004,7 +16112,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16069,7 +16177,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16147,7 +16255,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -16225,7 +16333,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16302,7 +16410,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16388,7 +16496,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16451,7 +16559,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16531,7 +16639,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -16596,7 +16704,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16674,7 +16782,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -16761,7 +16869,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -16855,7 +16963,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -16921,7 +17029,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -17000,7 +17108,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17076,7 +17184,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17206,7 +17314,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17268,7 +17376,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17395,7 +17503,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17459,7 +17567,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17549,7 +17657,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -17651,7 +17759,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17727,7 +17835,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17820,7 +17928,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17891,7 +17999,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -17962,7 +18070,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18182,7 +18290,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18260,7 +18368,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18340,7 +18448,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18429,7 +18537,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18495,7 +18603,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -18573,7 +18681,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18641,7 +18749,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18731,7 +18839,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18846,7 +18954,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18922,7 +19030,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19013,7 +19121,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19091,7 +19199,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19192,7 +19300,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -19256,7 +19364,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19341,7 +19449,7 @@ }, "x-appwrite": { "method": "list", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19417,7 +19525,7 @@ }, "x-appwrite": { "method": "create", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19508,7 +19616,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19596,7 +19704,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19684,7 +19792,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -19755,7 +19863,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -19819,7 +19927,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19907,7 +20015,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -19995,7 +20103,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20113,7 +20221,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20219,7 +20327,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20327,7 +20435,7 @@ }, "x-appwrite": { "method": "get", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -20382,7 +20490,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20446,7 +20554,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -20529,7 +20637,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -20614,7 +20722,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -20700,7 +20808,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20777,7 +20885,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20841,7 +20949,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20924,7 +21032,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21003,7 +21111,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21067,7 +21175,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21129,7 +21237,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21191,7 +21299,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21255,7 +21363,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21338,7 +21446,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21421,7 +21529,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21504,7 +21612,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -21566,7 +21674,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -21649,7 +21757,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21711,7 +21819,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21766,7 +21874,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21823,7 +21931,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21897,7 +22005,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21980,7 +22088,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -22056,7 +22164,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22169,7 +22277,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22242,7 +22350,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -22334,7 +22442,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -22409,7 +22517,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22494,7 +22602,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22577,7 +22685,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index b1b9ce8dca..4ebd7afd3e 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4802,6 +4802,111 @@ } } ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -5019,7 +5124,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -5101,7 +5206,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5186,7 +5291,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5307,7 +5412,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5381,7 +5486,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5457,7 +5562,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5533,7 +5638,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5589,7 +5694,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5645,7 +5750,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5701,7 +5806,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5757,7 +5862,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5813,7 +5918,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5869,7 +5974,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5925,7 +6030,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5981,7 +6086,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -6070,7 +6175,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -6145,7 +6250,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6230,7 +6335,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -6324,7 +6429,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6396,7 +6501,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6487,7 +6592,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6561,7 +6666,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6635,7 +6740,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6836,7 +6941,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6910,7 +7015,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6987,7 +7092,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -7081,7 +7186,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7145,7 +7250,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7222,7 +7327,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7288,7 +7393,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7373,7 +7478,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7490,7 +7595,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7562,7 +7667,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7650,7 +7755,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7724,7 +7829,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7822,7 +7927,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7885,7 +7990,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index c7b6bac2d4..bfcf354c83 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -4659,7 +4659,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4731,7 +4731,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4943,7 +4943,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8358,6 +8358,111 @@ } } ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -8575,7 +8680,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -9181,7 +9286,7 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -9345,7 +9450,7 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -9427,7 +9532,7 @@ }, "x-appwrite": { "method": "list", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9501,7 +9606,7 @@ }, "x-appwrite": { "method": "create", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9773,7 +9878,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9826,7 +9931,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9880,7 +9985,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9978,7 +10083,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -10040,7 +10145,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10114,7 +10219,7 @@ }, "x-appwrite": { "method": "get", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -10175,7 +10280,7 @@ }, "x-appwrite": { "method": "update", - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10417,7 +10522,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10480,7 +10585,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10562,7 +10667,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 299, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10656,7 +10761,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10725,7 +10830,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10789,7 +10894,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10855,7 +10960,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10939,7 +11044,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11010,7 +11115,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 296, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -11083,7 +11188,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11168,7 +11273,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11289,7 +11394,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11356,7 +11461,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11427,7 +11532,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11509,7 +11614,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11570,7 +11675,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11658,7 +11763,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11727,7 +11832,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11815,7 +11920,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11886,7 +11991,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11962,7 +12067,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -12038,7 +12143,7 @@ }, "x-appwrite": { "method": "get", - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12091,7 +12196,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12144,7 +12249,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12197,7 +12302,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12259,7 +12364,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12312,7 +12417,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12365,7 +12470,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12418,7 +12523,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12482,7 +12587,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12546,7 +12651,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12619,7 +12724,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12683,7 +12788,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12771,7 +12876,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12835,7 +12940,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12899,7 +13004,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12963,7 +13068,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -13027,7 +13132,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -13091,7 +13196,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -13155,7 +13260,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13219,7 +13324,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13283,7 +13388,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13336,7 +13441,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13389,7 +13494,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13442,7 +13547,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13498,7 +13603,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13554,7 +13659,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13610,7 +13715,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13666,7 +13771,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13722,7 +13827,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13778,7 +13883,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13834,7 +13939,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13890,7 +13995,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13967,7 +14072,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14127,7 +14232,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -14284,7 +14389,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14459,7 +14564,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -14631,7 +14736,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14751,7 +14856,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -14869,7 +14974,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -14928,7 +15033,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -14992,7 +15097,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -15068,7 +15173,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -15144,7 +15249,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15221,7 +15326,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15338,7 +15443,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -15453,7 +15558,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15546,7 +15651,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -15637,7 +15742,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15766,7 +15871,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15893,7 +15998,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15998,7 +16103,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16101,7 +16206,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16218,7 +16323,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16333,7 +16438,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16494,7 +16599,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16652,7 +16757,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16757,7 +16862,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16860,7 +16965,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16965,7 +17070,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17068,7 +17173,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17173,7 +17278,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17276,7 +17381,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -17381,7 +17486,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17484,7 +17589,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -17543,7 +17648,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17607,7 +17712,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -17683,7 +17788,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -17759,7 +17864,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17834,7 +17939,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17926,7 +18031,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17988,7 +18093,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18071,7 +18176,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -18135,7 +18240,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -18211,7 +18316,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -18294,7 +18399,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -18386,7 +18491,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -18453,7 +18558,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -18528,7 +18633,7 @@ }, "x-appwrite": { "method": "list", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18603,7 +18708,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18699,7 +18804,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18789,7 +18894,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18871,7 +18976,7 @@ }, "x-appwrite": { "method": "deleteFirebaseAuth", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -18923,7 +19028,7 @@ }, "x-appwrite": { "method": "createFirebaseOAuthMigration", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -19005,7 +19110,7 @@ }, "x-appwrite": { "method": "listFirebaseProjects", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -19057,7 +19162,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19130,7 +19235,7 @@ }, "x-appwrite": { "method": "getFirebaseReportOAuth", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19203,7 +19308,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -19326,7 +19431,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -19448,7 +19553,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -19564,7 +19669,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -19679,7 +19784,7 @@ }, "x-appwrite": { "method": "get", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -19739,7 +19844,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -19794,7 +19899,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -19856,7 +19961,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19942,7 +20047,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19992,7 +20097,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -20071,7 +20176,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -20131,7 +20236,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -20210,7 +20315,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -20272,7 +20377,7 @@ }, "x-appwrite": { "method": "list", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -20345,7 +20450,7 @@ }, "x-appwrite": { "method": "create", - "weight": 150, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -20497,7 +20602,7 @@ }, "x-appwrite": { "method": "get", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -20557,7 +20662,7 @@ }, "x-appwrite": { "method": "update", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20684,7 +20789,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20746,7 +20851,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20840,7 +20945,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20920,7 +21025,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -21000,7 +21105,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -21080,7 +21185,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -21138,7 +21243,7 @@ }, "\/projects\/{projectId}\/auth\/memberships-privacy": { "patch": { - "summary": "Update project team sensitive attributes", + "summary": "Update project memberships privacy attributes", "operationId": "projectsUpdateMembershipsPrivacy", "consumes": [ "application\/json" @@ -21160,7 +21265,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -21254,7 +21359,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21337,7 +21442,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21417,7 +21522,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21497,7 +21602,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -21577,7 +21682,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21657,7 +21762,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -21756,7 +21861,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21845,7 +21950,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21905,7 +22010,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -22001,7 +22106,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -22069,7 +22174,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -22166,7 +22271,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -22236,7 +22341,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -22377,7 +22482,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22437,7 +22542,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22561,7 +22666,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22629,7 +22734,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22728,7 +22833,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22798,7 +22903,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22900,7 +23005,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22980,7 +23085,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -23109,7 +23214,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -23249,7 +23354,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -23329,7 +23434,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23551,7 +23656,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23816,7 +23921,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24040,7 +24145,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -24259,7 +24364,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -24496,7 +24601,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -24717,7 +24822,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24777,7 +24882,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24899,7 +25004,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24967,7 +25072,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -25090,7 +25195,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -25160,7 +25265,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -25230,7 +25335,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -25303,7 +25408,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -25394,7 +25499,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -25449,7 +25554,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -25511,7 +25616,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -25573,7 +25678,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25647,7 +25752,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25788,7 +25893,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25849,7 +25954,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25984,7 +26089,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -26047,7 +26152,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -26132,7 +26237,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -26226,7 +26331,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -26298,7 +26403,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -26389,7 +26494,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -26463,7 +26568,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26537,7 +26642,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -26738,7 +26843,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -26812,7 +26917,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26886,7 +26991,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26968,7 +27073,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -27045,7 +27150,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -27139,7 +27244,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27203,7 +27308,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27280,7 +27385,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27346,7 +27451,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -27420,7 +27525,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27505,7 +27610,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -27622,7 +27727,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27694,7 +27799,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27782,7 +27887,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27856,7 +27961,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27953,7 +28058,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -28015,7 +28120,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -28097,7 +28202,7 @@ }, "x-appwrite": { "method": "list", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -28171,7 +28276,7 @@ }, "x-appwrite": { "method": "create", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -28268,7 +28373,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28361,7 +28466,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28454,7 +28559,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -28525,7 +28630,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -28588,7 +28693,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -28681,7 +28786,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28774,7 +28879,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28902,7 +29007,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -29016,7 +29121,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -29130,7 +29235,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -29204,7 +29309,7 @@ }, "x-appwrite": { "method": "get", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -29260,7 +29365,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -29323,7 +29428,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29404,7 +29509,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -29488,7 +29593,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29572,7 +29677,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -29647,7 +29752,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29710,7 +29815,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29791,7 +29896,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29867,7 +29972,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29930,7 +30035,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29991,7 +30096,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -30052,7 +30157,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -30115,7 +30220,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30196,7 +30301,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -30277,7 +30382,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -30358,7 +30463,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30419,7 +30524,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30500,7 +30605,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -30561,7 +30666,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -30617,7 +30722,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -30675,7 +30780,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30746,7 +30851,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -30827,7 +30932,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -30901,7 +31006,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31016,7 +31121,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -31086,7 +31191,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -31180,7 +31285,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -31252,7 +31357,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -31336,7 +31441,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -31417,7 +31522,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -31498,7 +31603,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -31567,7 +31672,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -31654,7 +31759,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -31724,7 +31829,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -31794,7 +31899,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 277, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31873,7 +31978,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -31953,7 +32058,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -32041,7 +32146,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 284, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -32116,7 +32221,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -32171,7 +32276,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -36591,17 +36696,17 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, - "membershipsUserName": { + "authMembershipsUserName": { "type": "boolean", "description": "Whether or not to show user names in the teams membership response.", "x-example": true }, - "membershipsUserEmail": { + "authMembershipsUserEmail": { "type": "boolean", "description": "Whether or not to show user emails in the teams membership response.", "x-example": true }, - "membershipsMfa": { + "authMembershipsMfa": { "type": "boolean", "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true @@ -36815,9 +36920,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", - "membershipsUserName", - "membershipsUserEmail", - "membershipsMfa", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 2c8e80c65e..9e931ad04f 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7874,6 +7874,113 @@ } } ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -8095,7 +8202,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, @@ -8535,7 +8642,7 @@ }, "x-appwrite": { "method": "list", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8610,7 +8717,7 @@ }, "x-appwrite": { "method": "create", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8883,7 +8990,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8937,7 +9044,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8992,7 +9099,7 @@ }, "x-appwrite": { "method": "get", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9054,7 +9161,7 @@ }, "x-appwrite": { "method": "update", - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9297,7 +9404,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9361,7 +9468,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9444,7 +9551,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 299, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9539,7 +9646,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9609,7 +9716,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9674,7 +9781,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9741,7 +9848,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9826,7 +9933,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9898,7 +10005,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 296, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9972,7 +10079,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10059,7 +10166,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10182,7 +10289,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10251,7 +10358,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10323,7 +10430,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10385,7 +10492,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10474,7 +10581,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10544,7 +10651,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10633,7 +10740,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10705,7 +10812,7 @@ }, "x-appwrite": { "method": "query", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10783,7 +10890,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10861,7 +10968,7 @@ }, "x-appwrite": { "method": "get", - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -10915,7 +11022,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -10969,7 +11076,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11023,7 +11130,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11086,7 +11193,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11140,7 +11247,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11194,7 +11301,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11248,7 +11355,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11313,7 +11420,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11378,7 +11485,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11452,7 +11559,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11517,7 +11624,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11606,7 +11713,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11671,7 +11778,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11736,7 +11843,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11801,7 +11908,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11866,7 +11973,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11931,7 +12038,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11996,7 +12103,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12061,7 +12168,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12126,7 +12233,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12180,7 +12287,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12234,7 +12341,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12288,7 +12395,7 @@ }, "x-appwrite": { "method": "get", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12346,7 +12453,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12404,7 +12511,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12462,7 +12569,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12520,7 +12627,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12578,7 +12685,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12636,7 +12743,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12694,7 +12801,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12752,7 +12859,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -12830,7 +12937,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -12991,7 +13098,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -13149,7 +13256,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13325,7 +13432,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -13498,7 +13605,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13619,7 +13726,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -13738,7 +13845,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -13798,7 +13905,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -13863,7 +13970,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13940,7 +14047,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14017,7 +14124,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14095,7 +14202,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14213,7 +14320,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -14329,7 +14436,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14423,7 +14530,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -14515,7 +14622,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -14645,7 +14752,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14773,7 +14880,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14879,7 +14986,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14983,7 +15090,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15101,7 +15208,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15217,7 +15324,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15379,7 +15486,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15538,7 +15645,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15644,7 +15751,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15748,7 +15855,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15854,7 +15961,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15958,7 +16065,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16064,7 +16171,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16168,7 +16275,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16274,7 +16381,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16378,7 +16485,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16438,7 +16545,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16503,7 +16610,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16580,7 +16687,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -16657,7 +16764,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16733,7 +16840,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16826,7 +16933,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16889,7 +16996,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16973,7 +17080,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17038,7 +17145,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17115,7 +17222,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -17199,7 +17306,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -17293,7 +17400,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -17361,7 +17468,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -17438,7 +17545,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17513,7 +17620,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17655,7 +17762,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17717,7 +17824,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17853,7 +17960,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17917,7 +18024,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -18004,7 +18111,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 207, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -18100,7 +18207,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -18174,7 +18281,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -18267,7 +18374,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -18343,7 +18450,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18419,7 +18526,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18622,7 +18729,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18698,7 +18805,7 @@ }, "x-appwrite": { "method": "list", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18777,7 +18884,7 @@ }, "x-appwrite": { "method": "create", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18873,7 +18980,7 @@ }, "x-appwrite": { "method": "get", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18939,7 +19046,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19018,7 +19125,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19086,7 +19193,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -19173,7 +19280,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -19292,7 +19399,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19366,7 +19473,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19456,7 +19563,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19532,7 +19639,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19631,7 +19738,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -19695,7 +19802,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19779,7 +19886,7 @@ }, "x-appwrite": { "method": "list", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19854,7 +19961,7 @@ }, "x-appwrite": { "method": "create", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19952,7 +20059,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20046,7 +20153,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -20140,7 +20247,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -20212,7 +20319,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -20276,7 +20383,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -20370,7 +20477,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20464,7 +20571,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20593,7 +20700,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20708,7 +20815,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20823,7 +20930,7 @@ }, "x-appwrite": { "method": "get", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -20880,7 +20987,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20944,7 +21051,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21026,7 +21133,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -21111,7 +21218,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -21196,7 +21303,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -21272,7 +21379,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21336,7 +21443,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21418,7 +21525,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21495,7 +21602,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21559,7 +21666,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21621,7 +21728,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21683,7 +21790,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21747,7 +21854,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21829,7 +21936,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21911,7 +22018,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21993,7 +22100,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22055,7 +22162,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22137,7 +22244,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -22199,7 +22306,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22256,7 +22363,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -22315,7 +22422,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22387,7 +22494,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -22469,7 +22576,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -22544,7 +22651,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22660,7 +22767,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22731,7 +22838,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -22826,7 +22933,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -22899,7 +23006,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22984,7 +23091,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -23066,7 +23173,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, From 6faad2990764c9e3a4b33f573900cc8a68a13fe4 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 12 Nov 2024 10:20:46 +0900 Subject: [PATCH 010/161] Initial Version --- app/controllers/api/databases.php | 144 +++++++++++------- .../e2e/Services/Databases/DatabasesBase.php | 122 +++++++++++++++ 2 files changed, 208 insertions(+), 58 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 0114fd343c..4329565c05 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2844,7 +2844,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('Create document') ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.create') ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'document.create') @@ -2858,13 +2858,14 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) + ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') ->param('databaseId', '', new UID(), 'Database ID.') - ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') - ->param('data', [], new JSON(), 'Document data as JSON object.') + ->param('data', [], new JSON(), 'Document data as JSON object.', true) + ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of documents data as JSON object.', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') @@ -2872,16 +2873,29 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('mode') - ->action(function (string $databaseId, string $documentId, string $collectionId, string|array $data, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, string $mode) { - + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, string $mode) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + $isBulk = true; - if (empty($data)) { + if (empty($data) && empty($documents)) { throw new Exception(Exception::DOCUMENT_MISSING_DATA); } - if (isset($data['$id'])) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, '$id is not allowed for creating new documents, try update instead'); + if (!empty($data) && !empty($documents)) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, 'You can only send one of the following parameters: data, documents'); + } + + if (!empty($data) && empty($documentId)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Document ID is required when creating a single document'); // TODO: Make into normal error type + } + + if (!empty($documents) && !empty($documentId)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Document ID is not required when creating multiple documents'); // TODO: Make into normal error type + } + + if (!empty($data)) { + $isBulk = false; + $documents = [$data]; } $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); @@ -2938,11 +2952,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } } - $data['$collection'] = $collection->getId(); // Adding this param to make API easier for developers - $data['$id'] = $documentId == 'unique()' ? ID::unique() : $documentId; - $data['$permissions'] = $permissions; - $document = new Document($data); - $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database) { $documentSecurity = $collection->getAttribute('documentSecurity', false); $validator = new Authorization($permission); @@ -3023,10 +3032,29 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } }; - $checkPermissions($collection, $document, Database::PERMISSION_CREATE); + $documents = array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId) { + $document['$collection'] = $collection->getId(); + $document['$permissions'] = $permissions; + + if (!$isBulk) { + $document['$id'] = $documentId == 'unique()' ? ID::unique() : $documentId; + } else { + if (empty($document['$id'])) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, '$id is required inside documents when creating bulk documents'); + } + + $document['$id'] = $document['$id'] == 'unique()' ? ID::unique() : $document['$id']; + } + + $document = new Document($document); + + $checkPermissions($collection, $document, Database::PERMISSION_CREATE); + + return $document; + }, $documents); try { - $document = $dbForProject->createDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $document); + $dbForProject->createDocuments('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documents); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); } catch (DuplicateException $e) { @@ -3035,61 +3063,61 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); + if ($isBulk) { + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic(new Document([ + 'modified' => count($documents), + ]), Response::MODEL_BULK_OPERATION); + } else { + // Add $collectionId and $databaseId for all documents + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $document->removeAttribute('$collection'); + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP ); - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + if (!\is_array($related)) { + $related = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + ); + + foreach ($related as $relation) { + if ($relation instanceof Document) { + $processDocument($relatedCollection, $relation); + } } } - } - }; + }; - $processDocument($collection, $document); + $document = $documents[0]; + $processDocument($collection, $document); - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($document, Response::MODEL_DOCUMENT); - - $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), - \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ) - ); + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($document, Response::MODEL_DOCUMENT); + } $queueForEvents ->setParam('databaseId', $databaseId) ->setParam('collectionId', $collection->getId()) - ->setParam('documentId', $document->getId()) ->setContext('collection', $collection) ->setContext('database', $database) - ->setPayload($response->getPayload(), sensitive: $relationships); - + ->setPayload($response->getPayload()); $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index d079cb313c..c1bb6939d9 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4799,4 +4799,126 @@ trait DatabasesBase $this->assertEquals(408, $response['headers']['status-code']); } + + public function testBulkCreate(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Create' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Create', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['modified']); + + $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // TEST FAIL - Can't use data and document together + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 5 + ], + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('You can only send one of the following parameters: data, documents', $response['body']['message']); + + // TEST FAIL - Can't use $documentId and create bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + } } From 92c93357cf376fdea1bcec5d91273bc70f814d17 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 12 Nov 2024 11:41:08 +0900 Subject: [PATCH 011/161] Address Jake's Comments --- app/controllers/api/databases.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 5c3baf3b63..9e458fb877 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3689,14 +3689,13 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum }); App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') - ->alias('/v1/database/collections/:collectionId/documents') ->desc('Update documents') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.update') ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'documents.update') - ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->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) @@ -3706,7 +3705,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.description', '/docs/references/databases/update-documents.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) + ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -3740,11 +3739,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); // Map aggregate permissions into the multiple permissions they represent. $permissions = Permission::aggregate($permissions, [ @@ -3793,16 +3788,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $response->dynamic(new Document([ - 'modified' => $modified - ]), Response::MODEL_BULK_OPERATION); - $queueForEvents ->setParam('databaseId', $databaseId) ->setParam('collectionId', $collection->getId()) ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->getPayload()); + ->setContext('database', $database); + + $response->dynamic(new Document([ + 'modified' => $modified + ]), Response::MODEL_BULK_OPERATION); }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') From 172d25d67c8641f25c8e98b95bf03daf349abfd7 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 12 Nov 2024 15:43:36 +0900 Subject: [PATCH 012/161] Address Comments --- app/controllers/api/databases.php | 10 +++++-- app/controllers/shared/api.php | 6 ++++ composer.lock | 48 +++++++++++++++---------------- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b76229e725..a458407b86 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3810,7 +3810,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') - ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('Delete documents') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -3826,7 +3825,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.method', 'deleteDocuments') ->label('sdk.description', '/docs/references/databases/delete-documents.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') ->param('databaseId', '', new UID(), 'Database ID.') @@ -3864,6 +3864,12 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ); }); + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setContext('collection', $collection) + ->setContext('database', $database); + return $response->dynamic(new Document([ 'modified' => $modified, ]), Response::MODEL_BULK_OPERATION); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f5921bf6e8..349e88e16b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -90,6 +90,11 @@ $eventDatabaseListener = function (Document $document, Response $response, Event $usageDatabaseListener = function (string $event, Document $document, Usage $queueForUsage) { $value = 1; + + if ($event === Database::EVENT_DOCUMENTS_DELETE) { + $value = -1 * count($document->getAttribute('$ids', [])); + } + if ($event === Database::EVENT_DOCUMENT_DELETE) { $value = -1; } @@ -497,6 +502,7 @@ App::init() $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENTS_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $document, $response, diff --git a/composer.lock b/composer.lock index 5a61332b2a..00a2e85678 100644 --- a/composer.lock +++ b/composer.lock @@ -2222,16 +2222,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.11", + "version": "0.6.12", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7" + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", "shasum": "" }, "require": { @@ -2272,9 +2272,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.11" + "source": "https://github.com/utopia-php/migration/tree/0.6.12" }, - "time": "2024-10-31T06:19:57+00:00" + "time": "2024-11-12T00:31:53+00:00" }, { "name": "utopia-php/mongo", @@ -2542,16 +2542,16 @@ }, { "name": "utopia-php/queue", - "version": "0.7.1", + "version": "0.7.2", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8" + "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/94c240d9f6383829807ce7b2d737f04b159fd3e8", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/40fdd9799d0a11dd33fca06f8223032a47dce2f6", + "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6", "shasum": "" }, "require": { @@ -2597,9 +2597,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.1" + "source": "https://github.com/utopia-php/queue/tree/0.7.2" }, - "time": "2024-11-05T17:00:38+00:00" + "time": "2024-11-11T10:04:02+00:00" }, { "name": "utopia-php/registry", @@ -2817,16 +2817,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.3", + "version": "0.8.5", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337" + "reference": "7622330628d53844a3873ca873338150756bab82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a032ed0611a8f4467aeaa9484f73223074457337", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82", + "reference": "7622330628d53844a3873ca873338150756bab82", "shasum": "" }, "require": { @@ -2860,9 +2860,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.3" + "source": "https://github.com/utopia-php/vcs/tree/0.8.5" }, - "time": "2024-11-05T17:10:09+00:00" + "time": "2024-11-11T18:33:10+00:00" }, { "name": "utopia-php/websocket", @@ -6923,16 +6923,16 @@ }, { "name": "twig/twig", - "version": "v3.14.1", + "version": "v3.14.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379" + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/f405356d20fb43603bcadc8b09bfb676cb04a379", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", "shasum": "" }, "require": { @@ -6986,7 +6986,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.1" + "source": "https://github.com/twigphp/Twig/tree/v3.14.2" }, "funding": [ { @@ -6998,7 +6998,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T18:17:38+00:00" + "time": "2024-11-07T12:36:22+00:00" }, { "name": "webmozart/glob", From aa426085288ad5e81f5d8de3bc7839ccd0bd5e5c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Nov 2024 09:22:47 +0900 Subject: [PATCH 013/161] Regen Specs --- app/config/specs/open-api3-latest-client.json | 33 +++++++++--- .../specs/open-api3-latest-console.json | 47 ++++++++++++----- app/config/specs/open-api3-latest-server.json | 33 +++++++++--- app/config/specs/swagger2-latest-client.json | 38 ++++++++++---- app/config/specs/swagger2-latest-console.json | 52 +++++++++++++------ app/config/specs/swagger2-latest-server.json | 38 ++++++++++---- 6 files changed, 179 insertions(+), 62 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index e3cd909b4e..a79b4e9fda 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4540,11 +4540,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "$ref": "#\/components\/schemas\/bulkOperation" } } } @@ -4620,6 +4620,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4628,11 +4636,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } } @@ -9865,6 +9869,21 @@ "identifier", "expired" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 4e97fecc30..4996a55599 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8109,11 +8109,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "$ref": "#\/components\/schemas\/bulkOperation" } } } @@ -8189,6 +8189,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -8197,11 +8205,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } } @@ -20672,7 +20676,7 @@ }, "\/projects\/{projectId}\/auth\/memberships-privacy": { "patch": { - "summary": "Update project team sensitive attributes", + "summary": "Update project memberships privacy attributes", "operationId": "projectsUpdateMembershipsPrivacy", "tags": [ "projects" @@ -36077,17 +36081,17 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, - "membershipsUserName": { + "authMembershipsUserName": { "type": "boolean", "description": "Whether or not to show user names in the teams membership response.", "x-example": true }, - "membershipsUserEmail": { + "authMembershipsUserEmail": { "type": "boolean", "description": "Whether or not to show user emails in the teams membership response.", "x-example": true }, - "membershipsMfa": { + "authMembershipsMfa": { "type": "boolean", "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true @@ -36297,9 +36301,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", - "membershipsUserName", - "membershipsUserEmail", - "membershipsMfa", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -38727,6 +38731,21 @@ "projectId", "displayName" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index e84b751743..a33cde6511 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7636,11 +7636,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "$ref": "#\/components\/schemas\/bulkOperation" } } } @@ -7718,6 +7718,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -7726,11 +7734,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } } @@ -27097,6 +27101,21 @@ "identifier", "expired" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "securitySchemes": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index b1b9ce8dca..46ebf3c837 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4712,9 +4712,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "schema": { - "$ref": "#\/definitions\/document" + "$ref": "#\/definitions\/bulkOperation" } } }, @@ -4776,15 +4776,24 @@ "documentId": { "type": "string", "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, + "default": "", "x-example": "" }, "data": { "type": "object", "description": "Document data as JSON object.", - "default": {}, + "default": [], "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4794,11 +4803,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] @@ -10047,6 +10052,21 @@ "identifier", "expired" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index c7b6bac2d4..ac6f1dba63 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8268,9 +8268,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "schema": { - "$ref": "#\/definitions\/document" + "$ref": "#\/definitions\/bulkOperation" } } }, @@ -8332,15 +8332,24 @@ "documentId": { "type": "string", "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, + "default": "", "x-example": "" }, "data": { "type": "object", "description": "Document data as JSON object.", - "default": {}, + "default": [], "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -8350,11 +8359,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] @@ -21138,7 +21143,7 @@ }, "\/projects\/{projectId}\/auth\/memberships-privacy": { "patch": { - "summary": "Update project team sensitive attributes", + "summary": "Update project memberships privacy attributes", "operationId": "projectsUpdateMembershipsPrivacy", "consumes": [ "application\/json" @@ -36591,17 +36596,17 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, - "membershipsUserName": { + "authMembershipsUserName": { "type": "boolean", "description": "Whether or not to show user names in the teams membership response.", "x-example": true }, - "membershipsUserEmail": { + "authMembershipsUserEmail": { "type": "boolean", "description": "Whether or not to show user emails in the teams membership response.", "x-example": true }, - "membershipsMfa": { + "authMembershipsMfa": { "type": "boolean", "description": "Whether or not to show user MFA status in the teams membership response.", "x-example": true @@ -36815,9 +36820,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", - "membershipsUserName", - "membershipsUserEmail", - "membershipsMfa", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -39294,6 +39299,21 @@ "projectId", "displayName" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 2c8e80c65e..146e3d29b6 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7782,9 +7782,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "BulkOperation", "schema": { - "$ref": "#\/definitions\/document" + "$ref": "#\/definitions\/bulkOperation" } } }, @@ -7848,15 +7848,24 @@ "documentId": { "type": "string", "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": null, + "default": "", "x-example": "" }, "data": { "type": "object", "description": "Document data as JSON object.", - "default": {}, + "default": [], "x-example": "{}" }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -7866,11 +7875,7 @@ "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] @@ -27589,6 +27594,21 @@ "identifier", "expired" ] + }, + "bulkOperation": { + "description": "BulkOperation", + "type": "object", + "properties": { + "modified": { + "type": "integer", + "description": "Total number of documents affected by the operation.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "modified" + ] } }, "externalDocs": { From a8f3b63dedff334433bb8d13f497c2e371dd12b0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Nov 2024 10:00:40 +0900 Subject: [PATCH 014/161] Add Tests for Relationships and Permissions, Update error messages to be a little clearer --- app/controllers/api/databases.php | 6 +- .../e2e/Services/Databases/DatabasesBase.php | 157 ++++++++++++++- .../Databases/DatabasesCustomClientTest.php | 189 ++++++++++++++++++ 3 files changed, 346 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4329565c05..b06866ce43 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2886,11 +2886,11 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } if (!empty($data) && empty($documentId)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Document ID is required when creating a single document'); // TODO: Make into normal error type + throw new Exception(Exception::DOCUMENT_MISSING_DATA, 'Document ID is required when creating a single document'); } - + if (!empty($documents) && !empty($documentId)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Document ID is not required when creating multiple documents'); // TODO: Make into normal error type + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, use $id inside the documents'); } if (!empty($data)) { diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index c1bb6939d9..62b5118283 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4809,7 +4809,7 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'databaseId' => ID::unique(), - 'name' => 'Bulk Create' + 'name' => 'Bulk Create Perms', ]); $this->assertNotEmpty($database['body']['$id']); @@ -4822,7 +4822,7 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ 'collectionId' => ID::unique(), - 'name' => 'Bulk Create', + 'name' => 'Bulk Create Perms', 'documentSecurity' => true, 'permissions' => [ Permission::create(Role::any()), @@ -4916,9 +4916,160 @@ trait DatabasesBase 'number' => 1, ] ], - ]); + ]); $this->assertEquals(400, $response['headers']['status-code']); + // TEST FAIL - Can't miss $id in bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('$id is required inside documents when creating bulk documents', $response['body']['message']); + } + + public function testBulkCreateRelationships(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Creates Relationships' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection1', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Collection2', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $collection1 = $collection1['body']['$id']; + $collection2 = $collection2['body']['$id']; + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_RESTRICT, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + sleep(3); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'name' => 'Document 1', + 'collection2' => [ + [ + '$id' => ID::unique(), + 'name' => 'Document 2', + ], + [ + '$id' => ID::unique(), + 'name' => 'Document 3', + ], + ], + ], + [ + '$id' => ID::unique(), + 'name' => 'Document 2', + 'collection2' => [ + [ + '$id' => ID::unique(), + 'name' => 'Document 4', + ], + [ + '$id' => ID::unique(), + 'name' => 'Document 5', + ], + ], + ], + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['modified']); + + $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collection2}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(4, $response['body']['total']); } } diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 8484996058..51e679c86e 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -890,4 +890,193 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); } + + public function testBulkCreatePermissions(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Create' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Create', + 'documentSecurity' => true, + 'permissions' => [ + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + sleep(2); + + // TEST FAIL - Can't create document with missing collection level permissions + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); + + // TEST FAIL - Can't create document with missing document level permissions + $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Bulk Creates Perms', + 'documentSecurity' => true + ]); + + $this->assertEquals(200, $collection['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); + + // TEST FAIL - Can't create document with permissions that aren't our own. + $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'name' => 'Bulk Creates Perms', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(200, $collection['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + 'permissions' => [ + Permission::write(Role::user('aaaaaa')), + Permission::read(Role::user('aaaaaa')), + Permission::update(Role::user('aaaaaa')), + Permission::delete(Role::user('aaaaaa')), + ] + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + + // TEST SUCCESS - Can create document with our own permissions. + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + 'permissions' => [ + Permission::write(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['modified']); + } } From dd6bd745dfb54e5e12422618ad306496d18cec8a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Nov 2024 13:41:18 +0900 Subject: [PATCH 015/161] Address Comments, fix permission bug --- app/controllers/api/databases.php | 3 + composer.lock | 86 +++++++++---------- .../e2e/Services/Databases/DatabasesBase.php | 77 ++++++++++++++--- .../Databases/DatabasesCustomClientTest.php | 8 +- 4 files changed, 116 insertions(+), 58 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 9e458fb877..4e991574c4 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3769,6 +3769,9 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } } + if (!\is_null($permissions)) { + $data['$permissions'] = $permissions; + } $partialDocument = new Document($data); try { diff --git a/composer.lock b/composer.lock index 5a61332b2a..8f9d71ea59 100644 --- a/composer.lock +++ b/composer.lock @@ -2222,16 +2222,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.11", + "version": "0.6.12", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7" + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", "shasum": "" }, "require": { @@ -2272,9 +2272,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.11" + "source": "https://github.com/utopia-php/migration/tree/0.6.12" }, - "time": "2024-10-31T06:19:57+00:00" + "time": "2024-11-12T00:31:53+00:00" }, { "name": "utopia-php/mongo", @@ -2542,16 +2542,16 @@ }, { "name": "utopia-php/queue", - "version": "0.7.1", + "version": "0.7.2", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8" + "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/94c240d9f6383829807ce7b2d737f04b159fd3e8", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/40fdd9799d0a11dd33fca06f8223032a47dce2f6", + "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6", "shasum": "" }, "require": { @@ -2597,9 +2597,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.1" + "source": "https://github.com/utopia-php/queue/tree/0.7.2" }, - "time": "2024-11-05T17:00:38+00:00" + "time": "2024-11-11T10:04:02+00:00" }, { "name": "utopia-php/registry", @@ -2817,16 +2817,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.3", + "version": "0.8.5", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337" + "reference": "7622330628d53844a3873ca873338150756bab82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a032ed0611a8f4467aeaa9484f73223074457337", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82", + "reference": "7622330628d53844a3873ca873338150756bab82", "shasum": "" }, "require": { @@ -2860,9 +2860,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.3" + "source": "https://github.com/utopia-php/vcs/tree/0.8.5" }, - "time": "2024-11-05T17:10:09+00:00" + "time": "2024-11-11T18:33:10+00:00" }, { "name": "utopia-php/websocket", @@ -4051,16 +4051,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.5.1", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f" + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0c70d2c566e899666f367ab7b80986beb3581e6f", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", "shasum": "" }, "require": { @@ -4069,7 +4069,7 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { @@ -4109,9 +4109,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" }, - "time": "2024-11-06T11:58:54+00:00" + "time": "2024-11-12T11:25:25+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -4242,30 +4242,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -4283,9 +4283,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6923,16 +6923,16 @@ }, { "name": "twig/twig", - "version": "v3.14.1", + "version": "v3.14.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379" + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/f405356d20fb43603bcadc8b09bfb676cb04a379", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", "shasum": "" }, "require": { @@ -6986,7 +6986,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.1" + "source": "https://github.com/twigphp/Twig/tree/v3.14.2" }, "funding": [ { @@ -6998,7 +6998,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T18:17:38+00:00" + "time": "2024-11-07T12:36:22+00:00" }, { "name": "webmozart/glob", diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 6cb162e8f1..ea62ad2efc 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4901,17 +4901,15 @@ trait DatabasesBase $this->assertEquals(200, $documents['headers']['status-code']); $this->assertEquals(10, $documents['body']['total']); - if ($this->getSide() === 'client') { - foreach ($documents['body']['documents'] as $document) { - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $document['$permissions']); - } + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); } - // TEST: Update documents with query + // TEST: Check permissions persist $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -4919,6 +4917,37 @@ trait DatabasesBase 'data' => [ 'number' => 200 ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(10, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [200])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + } + + // TEST: Update documents with limit + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], 'queries' => [ Query::limit(5)->toString(), ], @@ -4943,7 +4972,7 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'data' => [ - 'number' => 200 + 'number' => 300 ], 'queries' => [ Query::offset(5)->toString(), @@ -4957,7 +4986,33 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [200])->toString()] + 'queries' => [Query::equal('number', [300])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + // TEST: Update documents with equals filter + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 400 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(10, $response['body']['modified']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [400])->toString()] ]); $this->assertEquals(200, $documents['headers']['status-code']); diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 934ba92a3e..745a97caf3 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -992,7 +992,8 @@ class DatabasesCustomClientTest extends Scope 'number' => 6, ], 'permissions' => [ - Permission::update(Role::user('user2')) + Permission::update(Role::user('user2')), + Permission::read(Role::user($this->getUser()['$id'])), ] ]); @@ -1012,9 +1013,8 @@ class DatabasesCustomClientTest extends Scope $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ 'queries' => [Query::notEqual('number', 100)->toString()] ]); From bb7234fa98d776285b495945ccde53c7cda00022 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 13 Nov 2024 13:45:16 +0900 Subject: [PATCH 016/161] Update database version --- composer.json | 2 +- composer.lock | 52 +++++++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 237e2e9562..a812a1aeae 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.17", + "utopia-php/database": "0.53.21", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 00a2e85678..beac5d70cc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "971e88c7387ffd92d755772e0f4e7805", + "content-hash": "f752a48ef47f95d9a34c8d8bfebc86da", "packages": [ { "name": "adhocore/jwt", @@ -1770,16 +1770,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.17", + "version": "0.53.21", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a" + "reference": "2e6ae59ded11dff0ed9783324b123b3e3dff5f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/07e3e5a1f5dbf9b351aab138085bde06611b305a", - "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a", + "url": "https://api.github.com/repos/utopia-php/database/zipball/2e6ae59ded11dff0ed9783324b123b3e3dff5f41", + "reference": "2e6ae59ded11dff0ed9783324b123b3e3dff5f41", "shasum": "" }, "require": { @@ -1820,9 +1820,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.17" + "source": "https://github.com/utopia-php/database/tree/0.53.21" }, - "time": "2024-11-06T09:20:59+00:00" + "time": "2024-11-13T00:46:26+00:00" }, { "name": "utopia-php/domains", @@ -4051,16 +4051,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.5.1", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f" + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0c70d2c566e899666f367ab7b80986beb3581e6f", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", "shasum": "" }, "require": { @@ -4069,7 +4069,7 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { @@ -4109,9 +4109,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" }, - "time": "2024-11-06T11:58:54+00:00" + "time": "2024-11-12T11:25:25+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -4242,30 +4242,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -4283,9 +4283,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", From c0ef832784bb496744ab447029cba9fbbec1b8a2 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 14 Nov 2024 17:15:28 +0900 Subject: [PATCH 017/161] Try and fix events --- app/controllers/api/databases.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b06866ce43..d14b4c60af 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2844,7 +2844,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('Create document') ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.create') + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'document.create') @@ -3063,6 +3063,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collection->getId()) + ->setContext('collection', $collection) + ->setContext('database', $database); + if ($isBulk) { $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -3071,7 +3077,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ]), Response::MODEL_BULK_OPERATION); } else { // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -3102,6 +3108,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } } } + + $queueForEvents + ->setParam('documentId', $document->getId()); }; $document = $documents[0]; @@ -3112,13 +3121,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->dynamic($document, Response::MODEL_DOCUMENT); } - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database) - ->setPayload($response->getPayload()); - $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection }); From c210b2b8741a53ab309948c565f71b48af9a3522 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 14 Nov 2024 17:16:39 +0900 Subject: [PATCH 018/161] Address Comments --- app/controllers/api/databases.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4e991574c4..4514943745 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3774,22 +3774,14 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } $partialDocument = new Document($data); - try { - $modified = $dbForProject->withRequestTimestamp( - $requestTimestamp, - fn () => $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $partialDocument, - $queries - ) - ); - } catch (AuthorizationException) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } catch (StructureException $e) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } catch (NotFoundException $e) { - throw new Exception(Exception::COLLECTION_NOT_FOUND); - } + $modified = $dbForProject->withRequestTimestamp( + $requestTimestamp, + fn () => $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $partialDocument, + $queries + ) + ); $queueForEvents ->setParam('databaseId', $databaseId) From 96e69b55e1ccc0fcfb0927d06f5e9722a812470b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 15 Nov 2024 12:00:11 +0900 Subject: [PATCH 019/161] Add tests that are currently failing because of realtime and attempt to fix them --- app/controllers/api/databases.php | 8 +-- .../Realtime/RealtimeCustomClientTest.php | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index a458407b86..618af7babf 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3837,8 +3837,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('dbForProject') ->inject('queueForEvents') ->inject('queueForUsage') - ->inject('mode') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Usage $queueForUsage, string $mode) { + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Usage $queueForUsage) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -3870,7 +3869,10 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('collection', $collection) ->setContext('database', $database); - return $response->dynamic(new Document([ + $queueForUsage + ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection + + $response->dynamic(new Document([ 'modified' => $modified, ]), Response::MODEL_BULK_OPERATION); }); diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 616f309fd2..27390de7a2 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -862,6 +862,56 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']['payload']); $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); + /** + * Test Document Bulk Delete + */ + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Bradley Cooper' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $client->receive(); + + $documentId = $document['body']['$id']; + + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(3, $response['data']['channels']); + $this->assertContains('documents', $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + $this->assertNotEmpty($response['data']['payload']); + $client->close(); } From 755e86020fadc429ad08fcf7fc3f69f7ac76300d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 19 Nov 2024 10:09:55 +0900 Subject: [PATCH 020/161] Continue work on getting events working --- app/controllers/api/databases.php | 2 ++ src/Appwrite/Messaging/Adapter/Realtime.php | 7 ++++++- src/Appwrite/Utopia/Response/Model/BulkOperation.php | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 618af7babf..cc9edf8ef6 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3873,6 +3873,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection $response->dynamic(new Document([ + '$databaseId' => $databaseId, + '$collectionId' => $collectionId, 'modified' => $modified, ]), Response::MODEL_BULK_OPERATION); }); diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index dceafacf6e..f6c18a5bb0 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -3,6 +3,7 @@ namespace Appwrite\Messaging\Adapter; use Appwrite\Messaging\Adapter; +use Utopia\CLI\Console; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; @@ -132,6 +133,7 @@ class Realtime extends Adapter public static function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options = []): void { if (empty($channels) || empty($roles) || empty($projectId)) { + Console::error('Missing required parameters for Realtime event'); return; } @@ -309,7 +311,10 @@ class Realtime extends Adapter $channels[] = 'documents'; $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents'; - $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents.' . $payload->getId(); + + if (!empty($payload->getId())) { + $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents.' . $payload->getId(); + } $roles = $collection->getAttribute('documentSecurity', false) ? \array_merge($collection->getRead(), $payload->getRead()) diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php index 7c6d7f6fe9..afcc8ef2ab 100644 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -10,6 +10,18 @@ class BulkOperation extends Model public function __construct() { $this + ->addRule('$collectionId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Collection ID.', + 'default' => '', + 'example' => '5e5ea5c15117e', + ]) + ->addRule('$databaseId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Database ID.', + 'default' => '', + 'example' => '5e5ea5c15117e', + ]) ->addRule('modified', [ 'type' => self::TYPE_INTEGER, 'description' => 'Total number of documents affected by the operation.', From 79c043ec1f3c831c80107802db3ec231b9ee46e9 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 19 Nov 2024 11:47:23 +0900 Subject: [PATCH 021/161] Fix Tests --- app/controllers/api/databases.php | 2 +- app/controllers/shared/api.php | 6 + composer.json | 6 +- composer.lock | 2208 ++++++++++++++++++++++++----- 4 files changed, 1868 insertions(+), 354 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index d14b4c60af..e118c0acdb 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2858,7 +2858,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) + ->label('sdk.response.model', Response::MODEL_DOCUMENT) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f5921bf6e8..e346f85dd3 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -94,6 +94,10 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que $value = -1; } + if ($event === Database::EVENT_DOCUMENTS_CREATE) { + $value = \count($document->getAttribute('modified', [])); + } + switch (true) { case $document->getCollection() === 'teams': $queueForUsage @@ -497,6 +501,8 @@ App::init() $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENTS_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENTS_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $document, $response, diff --git a/composer.json b/composer.json index a04ca51d43..fd9150b236 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.16", + "utopia-php/database": "0.53.22", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", @@ -96,6 +96,10 @@ "config": { "platform": { "php": "8.3" + }, + "allow-plugins": { + "php-http/discovery": false, + "tbachert/spi": false } } } diff --git a/composer.lock b/composer.lock index 691a7e740e..ff388f2ef0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b358198535c1867eabed7c0f99135a57", + "content-hash": "71370f3036cd4e3d2e19783319850e0c", "packages": [ { "name": "adhocore/jwt", @@ -277,6 +277,66 @@ }, "time": "2024-07-15T13:18:35+00:00" }, + { + "name": "brick/math", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.12.1" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-11-29T23:19:16+00:00" + }, { "name": "chillerlan/php-qrcode", "version": "4.3.4", @@ -422,6 +482,87 @@ ], "time": "2024-07-17T01:04:28+00:00" }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.2", @@ -567,29 +708,73 @@ "time": "2024-05-03T06:31:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "name": "google/protobuf", + "version": "v4.28.3", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + }, + "time": "2024-10-22T22:27:17+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -621,9 +806,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "league/csv", @@ -906,6 +1091,553 @@ }, "time": "2019-09-10T13:16:29+00:00" }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "nyholm/psr7-server", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7-server.git", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "nyholm/nsa": "^1.1", + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nyholm\\Psr7Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "Helper classes to handle PSR-7 server requests", + "homepage": "http://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" + }, + { + "name": "open-telemetry/api", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/542064815d38a6df55af7957cd6f1d7d967c99c6", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6", + "shasum": "" + }, + "require": { + "open-telemetry/context": "^1.0", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" + }, + "conflict": { + "open-telemetry/sdk": "<=1.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-15T22:42:37+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-21T00:29:20+00:00" + }, + { + "name": "open-telemetry/exporter-otlp", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/exporter-otlp.git", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "shasum": "" + }, + "require": { + "open-telemetry/api": "^1.0", + "open-telemetry/gen-otlp-protobuf": "^1.1", + "open-telemetry/sdk": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "_register.php" + ], + "psr-4": { + "OpenTelemetry\\Contrib\\Otlp\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "OTLP exporter for OpenTelemetry.", + "keywords": [ + "Metrics", + "exporter", + "gRPC", + "http", + "opentelemetry", + "otel", + "otlp", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-04-30T18:28:30+00:00" + }, + { + "name": "open-telemetry/gen-otlp-protobuf", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.22 || ^4.0", + "php": "^8.0" + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": [ + "Metrics", + "apm", + "gRPC", + "logging", + "opentelemetry", + "otel", + "otlp", + "protobuf", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-30T11:49:49+00:00" + }, + { + "name": "open-telemetry/sdk", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nyholm/psr7-server": "^1.1", + "open-telemetry/api": "~1.0 || ~1.1", + "open-telemetry/context": "^1.0", + "open-telemetry/sem-conv": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "ramsey/uuid": "^3.0 || ^4.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php82": "^1.26", + "tbachert/spi": "^1.0.1" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations", + "open-telemetry/sdk-configuration": "File-based OpenTelemetry SDK configuration" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-18T21:01:35+00:00" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/1dba705fea74bc0718d04be26090e3697e56f4e6", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-28T09:20:31+00:00" + }, { "name": "paragonie/constant_time_encoding", "version": "v2.7.0", @@ -973,6 +1705,85 @@ }, "time": "2024-05-08T12:18:48+00:00" }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.9.1", @@ -1054,6 +1865,450 @@ ], "time": "2023-11-25T22:23:28+00:00" }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, { "name": "spomky-labs/otphp", "version": "v10.0.3", @@ -1129,6 +2384,245 @@ }, "time": "2022-03-17T08:00:35+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/http-client", + "version": "v7.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "^3.4.1", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.1.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:40:27+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "20414d96f391677bf80078aa55baece78b82647d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", + "reference": "20414d96f391677bf80078aa55baece78b82647d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.31.0", @@ -1289,6 +2783,217 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php82", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "5d2ed36f7734637dacc025f179698031951b1692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692", + "reference": "5d2ed36f7734637dacc025f179698031951b1692", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "tbachert/spi", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Nevay/spi.git", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nevay/spi/zipball/2ddfaf815dafb45791a61b08170de8d583c16062", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "composer/semver": "^1.0 || ^2.0 || ^3.0", + "php": "^8.1" + }, + "require-dev": { + "composer/composer": "^2.0", + "infection/infection": "^0.27.9", + "phpunit/phpunit": "^10.5", + "psalm/phar": "^5.18" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-main": "0.2.x-dev" + }, + "class": "Nevay\\SPI\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Nevay\\SPI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Service provider loading facility", + "keywords": [ + "service provider" + ], + "support": { + "issues": "https://github.com/Nevay/spi/issues", + "source": "https://github.com/Nevay/spi/tree/v1.0.2" + }, + "time": "2024-10-04T16:36:12+00:00" + }, { "name": "thecodingmachine/safe", "version": "v2.5.0", @@ -1770,16 +3475,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.16", + "version": "0.53.22", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "6661edffeef05b59e16d102b989a72f7f78cf7de" + "reference": "1f7cbd456f09f66049ede1cab0815775eb946dbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/6661edffeef05b59e16d102b989a72f7f78cf7de", - "reference": "6661edffeef05b59e16d102b989a72f7f78cf7de", + "url": "https://api.github.com/repos/utopia-php/database/zipball/1f7cbd456f09f66049ede1cab0815775eb946dbf", + "reference": "1f7cbd456f09f66049ede1cab0815775eb946dbf", "shasum": "" }, "require": { @@ -1820,9 +3525,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.16" + "source": "https://github.com/utopia-php/database/tree/0.53.22" }, - "time": "2024-11-06T03:07:16+00:00" + "time": "2024-11-18T03:58:10+00:00" }, { "name": "utopia-php/domains", @@ -1972,21 +3677,22 @@ }, { "name": "utopia-php/framework", - "version": "0.33.11", + "version": "0.33.13", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466" + "reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/354ff0d23bfc6e82bea0fe8e89e115cff1af8466", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466", + "url": "https://api.github.com/repos/utopia-php/http/zipball/4ecab88e424a136ffaa27cdf3db3c60f76c777e4", + "reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4", "shasum": "" }, "require": { - "php": ">=8.0", - "utopia-php/compression": "0.1.*" + "php": ">=8.1", + "utopia-php/compression": "0.1.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^1.2", @@ -2012,9 +3718,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.11" + "source": "https://github.com/utopia-php/http/tree/0.33.13" }, - "time": "2024-11-08T18:47:43+00:00" + "time": "2024-11-15T08:37:31+00:00" }, { "name": "utopia-php/image", @@ -2222,16 +3928,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.11", + "version": "0.6.12", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7" + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", - "reference": "4d167914d3f7fa1fe816b2b2c6f221e70166bfd7", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", + "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", "shasum": "" }, "require": { @@ -2272,9 +3978,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.11" + "source": "https://github.com/utopia-php/migration/tree/0.6.12" }, - "time": "2024-10-31T06:19:57+00:00" + "time": "2024-11-12T00:31:53+00:00" }, { "name": "utopia-php/mongo", @@ -2542,22 +4248,23 @@ }, { "name": "utopia-php/queue", - "version": "0.7.1", + "version": "0.7.3", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8" + "reference": "16074a98ee7d6212bc1228de200e13db470c098a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/94c240d9f6383829807ce7b2d737f04b159fd3e8", - "reference": "94c240d9f6383829807ce7b2d737f04b159fd3e8", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/16074a98ee7d6212bc1228de200e13db470c098a", + "reference": "16074a98ee7d6212bc1228de200e13db470c098a", "shasum": "" }, "require": { - "php": ">=8.0", + "php": ">=8.1", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^0.2.3", @@ -2597,9 +4304,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.1" + "source": "https://github.com/utopia-php/queue/tree/0.7.3" }, - "time": "2024-11-05T17:00:38+00:00" + "time": "2024-11-13T12:47:48+00:00" }, { "name": "utopia-php/registry", @@ -2816,17 +4523,67 @@ "time": "2024-10-09T14:44:01+00:00" }, { - "name": "utopia-php/vcs", - "version": "0.8.3", + "name": "utopia-php/telemetry", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/utopia-php/vcs.git", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337" + "url": "https://github.com/utopia-php/telemetry.git", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a032ed0611a8f4467aeaa9484f73223074457337", - "reference": "a032ed0611a8f4467aeaa9484f73223074457337", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "shasum": "" + }, + "require": { + "ext-opentelemetry": "*", + "ext-protobuf": "*", + "nyholm/psr7": "^1.8", + "open-telemetry/exporter-otlp": "^1.1", + "open-telemetry/sdk": "^1.1", + "php": ">=8.0", + "symfony/http-client": "^7.1" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "keywords": [ + "framework", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/telemetry/issues", + "source": "https://github.com/utopia-php/telemetry/tree/0.1.0" + }, + "time": "2024-11-13T10:29:53+00:00" + }, + { + "name": "utopia-php/vcs", + "version": "0.8.5", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/vcs.git", + "reference": "7622330628d53844a3873ca873338150756bab82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82", + "reference": "7622330628d53844a3873ca873338150756bab82", "shasum": "" }, "require": { @@ -2860,9 +4617,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.3" + "source": "https://github.com/utopia-php/vcs/tree/0.8.5" }, - "time": "2024-11-05T17:10:09+00:00" + "time": "2024-11-11T18:33:10+00:00" }, { "name": "utopia-php/websocket", @@ -3049,16 +4806,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.24", + "version": "0.39.25", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8" + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/412451c87f6ef17e24e9a5cf41721043d74c60c8", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5b5323636a8d75a1c4faaae9728098dd6a6a47d1", + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1", "shasum": "" }, "require": { @@ -3066,7 +4823,7 @@ "ext-json": "*", "ext-mbstring": "*", "matthiasmullie/minify": "1.3.*", - "php": ">=8.0", + "php": ">=8.3", "twig/twig": "3.14.*" }, "require-dev": { @@ -3094,9 +4851,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.24" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.25" }, - "time": "2024-10-09T19:13:27+00:00" + "time": "2024-11-08T10:16:34+00:00" }, { "name": "doctrine/annotations", @@ -4051,16 +5808,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.5.1", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f" + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/0c70d2c566e899666f367ab7b80986beb3581e6f", - "reference": "0c70d2c566e899666f367ab7b80986beb3581e6f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", "shasum": "" }, "require": { @@ -4069,7 +5826,7 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { @@ -4109,9 +5866,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.5.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" }, - "time": "2024-11-06T11:58:54+00:00" + "time": "2024-11-12T11:25:25+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -4242,30 +5999,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -4283,9 +6040,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4758,109 +6515,6 @@ }, "time": "2021-02-03T23:26:27+00:00" }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.2", @@ -5922,16 +7576,16 @@ }, { "name": "symfony/console", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -5995,7 +7649,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.7" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -6011,74 +7665,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/filesystem", @@ -6593,16 +8180,16 @@ }, { "name": "symfony/process", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", + "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", "shasum": "" }, "require": { @@ -6634,7 +8221,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.7" + "source": "https://github.com/symfony/process/tree/v7.1.8" }, "funding": [ { @@ -6650,103 +8237,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:12+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -6804,7 +8308,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -6820,7 +8324,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "textalk/websocket", @@ -6923,16 +8427,16 @@ }, { "name": "twig/twig", - "version": "v3.14.1", + "version": "v3.14.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379" + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/f405356d20fb43603bcadc8b09bfb676cb04a379", - "reference": "f405356d20fb43603bcadc8b09bfb676cb04a379", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", "shasum": "" }, "require": { @@ -6986,7 +8490,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.1" + "source": "https://github.com/twigphp/Twig/tree/v3.14.2" }, "funding": [ { @@ -6998,7 +8502,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T18:17:38+00:00" + "time": "2024-11-07T12:36:22+00:00" }, { "name": "webmozart/glob", From 791f0dda7957f29b86ff9d30b36ba0183dece8f5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 22 Nov 2024 10:43:45 +0900 Subject: [PATCH 022/161] Update to use new DB Lib and get realtime working --- app/controllers/api/databases.php | 37 +- composer.json | 2 +- composer.lock | 2155 ++++++++++++++--- src/Appwrite/Messaging/Adapter/Realtime.php | 5 +- .../e2e/Services/Databases/DatabasesBase.php | 20 +- .../Databases/DatabasesCustomClientTest.php | 2 +- .../Realtime/RealtimeCustomClientTest.php | 77 +- 7 files changed, 1927 insertions(+), 371 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index cc9edf8ef6..73098eda15 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,6 +4,7 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; +use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; @@ -3814,7 +3815,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->groups(['api', 'database']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.delete') ->label('audits.event', 'documents.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') @@ -3825,7 +3825,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.method', 'deleteDocuments') ->label('sdk.description', '/docs/references/databases/delete-documents.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) + ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') @@ -3836,8 +3836,10 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('queueForRealtime') ->inject('queueForUsage') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Usage $queueForUsage) { + ->inject('project') + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Realtime $queueForRealtime, Usage $queueForUsage, Document $project) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -3855,7 +3857,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $queries = Query::parseQueries($queries); - $modified = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { + $documents = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { return $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, @@ -3869,14 +3871,33 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('collection', $collection) ->setContext('database', $database); + // DB Storage Calculation $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection + + // Trigger all events, we do this manually since we have to trigger multiple. + foreach ($documents as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + + $queueForEvents + ->setProject($project) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].delete') + ->setParam('documentId', $document->getId()) + ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) + ->trigger(); + + if ($project->getId() !== 'console') { + $queueForRealtime + ->from($queueForEvents) + ->trigger(); + } + } $response->dynamic(new Document([ - '$databaseId' => $databaseId, - '$collectionId' => $collectionId, - 'modified' => $modified, - ]), Response::MODEL_BULK_OPERATION); + "total" => \count($documents), + "documents" => $documents, + ]), Response::MODEL_DOCUMENT_LIST); }); App::get('/v1/databases/usage') diff --git a/composer.json b/composer.json index a812a1aeae..b9cd44d1c4 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.21", + "utopia-php/database": "0.53.23", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index beac5d70cc..c68ab68db0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f752a48ef47f95d9a34c8d8bfebc86da", + "content-hash": "28e6c599d5da0991d373aba9f3988309", "packages": [ { "name": "adhocore/jwt", @@ -277,6 +277,66 @@ }, "time": "2024-07-15T13:18:35+00:00" }, + { + "name": "brick/math", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.12.1" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-11-29T23:19:16+00:00" + }, { "name": "chillerlan/php-qrcode", "version": "4.3.4", @@ -422,6 +482,87 @@ ], "time": "2024-07-17T01:04:28+00:00" }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.2", @@ -567,29 +708,73 @@ "time": "2024-05-03T06:31:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "name": "google/protobuf", + "version": "v4.28.3", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + }, + "time": "2024-10-22T22:27:17+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -621,9 +806,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "league/csv", @@ -906,6 +1091,553 @@ }, "time": "2019-09-10T13:16:29+00:00" }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "nyholm/psr7-server", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7-server.git", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "nyholm/nsa": "^1.1", + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nyholm\\Psr7Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "Helper classes to handle PSR-7 server requests", + "homepage": "http://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" + }, + { + "name": "open-telemetry/api", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/542064815d38a6df55af7957cd6f1d7d967c99c6", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6", + "shasum": "" + }, + "require": { + "open-telemetry/context": "^1.0", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" + }, + "conflict": { + "open-telemetry/sdk": "<=1.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-15T22:42:37+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-21T00:29:20+00:00" + }, + { + "name": "open-telemetry/exporter-otlp", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/exporter-otlp.git", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "shasum": "" + }, + "require": { + "open-telemetry/api": "^1.0", + "open-telemetry/gen-otlp-protobuf": "^1.1", + "open-telemetry/sdk": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "_register.php" + ], + "psr-4": { + "OpenTelemetry\\Contrib\\Otlp\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "OTLP exporter for OpenTelemetry.", + "keywords": [ + "Metrics", + "exporter", + "gRPC", + "http", + "opentelemetry", + "otel", + "otlp", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-04-30T18:28:30+00:00" + }, + { + "name": "open-telemetry/gen-otlp-protobuf", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.22 || ^4.0", + "php": "^8.0" + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": [ + "Metrics", + "apm", + "gRPC", + "logging", + "opentelemetry", + "otel", + "otlp", + "protobuf", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-30T11:49:49+00:00" + }, + { + "name": "open-telemetry/sdk", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nyholm/psr7-server": "^1.1", + "open-telemetry/api": "~1.0 || ~1.1", + "open-telemetry/context": "^1.0", + "open-telemetry/sem-conv": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "ramsey/uuid": "^3.0 || ^4.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php82": "^1.26", + "tbachert/spi": "^1.0.1" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations", + "open-telemetry/sdk-configuration": "File-based OpenTelemetry SDK configuration" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-18T21:01:35+00:00" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/1dba705fea74bc0718d04be26090e3697e56f4e6", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-28T09:20:31+00:00" + }, { "name": "paragonie/constant_time_encoding", "version": "v2.7.0", @@ -973,6 +1705,85 @@ }, "time": "2024-05-08T12:18:48+00:00" }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.9.1", @@ -1054,6 +1865,450 @@ ], "time": "2023-11-25T22:23:28+00:00" }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, { "name": "spomky-labs/otphp", "version": "v10.0.3", @@ -1129,6 +2384,245 @@ }, "time": "2022-03-17T08:00:35+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/http-client", + "version": "v7.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "^3.4.1", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.1.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:40:27+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "20414d96f391677bf80078aa55baece78b82647d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", + "reference": "20414d96f391677bf80078aa55baece78b82647d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.31.0", @@ -1289,6 +2783,217 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php82", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "5d2ed36f7734637dacc025f179698031951b1692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692", + "reference": "5d2ed36f7734637dacc025f179698031951b1692", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "tbachert/spi", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Nevay/spi.git", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nevay/spi/zipball/2ddfaf815dafb45791a61b08170de8d583c16062", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "composer/semver": "^1.0 || ^2.0 || ^3.0", + "php": "^8.1" + }, + "require-dev": { + "composer/composer": "^2.0", + "infection/infection": "^0.27.9", + "phpunit/phpunit": "^10.5", + "psalm/phar": "^5.18" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-main": "0.2.x-dev" + }, + "class": "Nevay\\SPI\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Nevay\\SPI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Service provider loading facility", + "keywords": [ + "service provider" + ], + "support": { + "issues": "https://github.com/Nevay/spi/issues", + "source": "https://github.com/Nevay/spi/tree/v1.0.2" + }, + "time": "2024-10-04T16:36:12+00:00" + }, { "name": "thecodingmachine/safe", "version": "v2.5.0", @@ -1770,16 +3475,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.21", + "version": "0.53.23", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "2e6ae59ded11dff0ed9783324b123b3e3dff5f41" + "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/2e6ae59ded11dff0ed9783324b123b3e3dff5f41", - "reference": "2e6ae59ded11dff0ed9783324b123b3e3dff5f41", + "url": "https://api.github.com/repos/utopia-php/database/zipball/b5bd17ef34f37018dca06cb764387e1e40bfe63a", + "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a", "shasum": "" }, "require": { @@ -1820,9 +3525,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.21" + "source": "https://github.com/utopia-php/database/tree/0.53.23" }, - "time": "2024-11-13T00:46:26+00:00" + "time": "2024-11-21T05:07:44+00:00" }, { "name": "utopia-php/domains", @@ -1972,21 +3677,22 @@ }, { "name": "utopia-php/framework", - "version": "0.33.11", + "version": "0.33.14", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466" + "reference": "45a5a2db3602fa054096f378482c7da9936f5850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/354ff0d23bfc6e82bea0fe8e89e115cff1af8466", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466", + "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", + "reference": "45a5a2db3602fa054096f378482c7da9936f5850", "shasum": "" }, "require": { - "php": ">=8.0", - "utopia-php/compression": "0.1.*" + "php": ">=8.1", + "utopia-php/compression": "0.1.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^1.2", @@ -2012,9 +3718,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.11" + "source": "https://github.com/utopia-php/http/tree/0.33.14" }, - "time": "2024-11-08T18:47:43+00:00" + "time": "2024-11-20T12:39:10+00:00" }, { "name": "utopia-php/image", @@ -2542,22 +4248,23 @@ }, { "name": "utopia-php/queue", - "version": "0.7.2", + "version": "0.7.3", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6" + "reference": "16074a98ee7d6212bc1228de200e13db470c098a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/40fdd9799d0a11dd33fca06f8223032a47dce2f6", - "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/16074a98ee7d6212bc1228de200e13db470c098a", + "reference": "16074a98ee7d6212bc1228de200e13db470c098a", "shasum": "" }, "require": { - "php": ">=8.0", + "php": ">=8.1", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^0.2.3", @@ -2597,9 +4304,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.2" + "source": "https://github.com/utopia-php/queue/tree/0.7.3" }, - "time": "2024-11-11T10:04:02+00:00" + "time": "2024-11-13T12:47:48+00:00" }, { "name": "utopia-php/registry", @@ -2815,6 +4522,56 @@ }, "time": "2024-10-09T14:44:01+00:00" }, + { + "name": "utopia-php/telemetry", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/telemetry.git", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "shasum": "" + }, + "require": { + "ext-opentelemetry": "*", + "ext-protobuf": "*", + "nyholm/psr7": "^1.8", + "open-telemetry/exporter-otlp": "^1.1", + "open-telemetry/sdk": "^1.1", + "php": ">=8.0", + "symfony/http-client": "^7.1" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "keywords": [ + "framework", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/telemetry/issues", + "source": "https://github.com/utopia-php/telemetry/tree/0.1.0" + }, + "time": "2024-11-13T10:29:53+00:00" + }, { "name": "utopia-php/vcs", "version": "0.8.5", @@ -3049,16 +4806,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.24", + "version": "0.39.25", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8" + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/412451c87f6ef17e24e9a5cf41721043d74c60c8", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5b5323636a8d75a1c4faaae9728098dd6a6a47d1", + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1", "shasum": "" }, "require": { @@ -3066,7 +4823,7 @@ "ext-json": "*", "ext-mbstring": "*", "matthiasmullie/minify": "1.3.*", - "php": ">=8.0", + "php": ">=8.3", "twig/twig": "3.14.*" }, "require-dev": { @@ -3094,9 +4851,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.24" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.25" }, - "time": "2024-10-09T19:13:27+00:00" + "time": "2024-11-08T10:16:34+00:00" }, { "name": "doctrine/annotations", @@ -3370,16 +5127,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -3432,7 +5189,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "matthiasmullie/minify", @@ -4173,26 +5930,27 @@ }, { "name": "phpspec/prophecy", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" @@ -4236,9 +5994,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2024-02-29T11:52:51+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -4758,109 +6516,6 @@ }, "time": "2021-02-03T23:26:27+00:00" }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.2", @@ -5922,16 +7577,16 @@ }, { "name": "symfony/console", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -5995,7 +7650,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.7" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -6011,74 +7666,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/filesystem", @@ -6593,16 +8181,16 @@ }, { "name": "symfony/process", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", + "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", "shasum": "" }, "require": { @@ -6634,7 +8222,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.7" + "source": "https://github.com/symfony/process/tree/v7.1.8" }, "funding": [ { @@ -6650,103 +8238,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:12+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -6804,7 +8309,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -6820,7 +8325,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "textalk/websocket", diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index f6c18a5bb0..cd3dcc57c0 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -311,10 +311,7 @@ class Realtime extends Adapter $channels[] = 'documents'; $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents'; - - if (!empty($payload->getId())) { - $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents.' . $payload->getId(); - } + $channels[] = 'databases.' . $database->getId() . '.collections.' . $payload->getAttribute('$collectionId') . '.documents.' . $payload->getId(); $roles = $collection->getAttribute('documentSecurity', false) ? \array_merge($collection->getRead(), $payload->getRead()) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 9895e8b9ba..f2a4728eef 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4887,7 +4887,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(11, $response['body']['modified']); + $this->assertEquals(11, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4918,7 +4918,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4939,7 +4939,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); // SUCCESS: Delete documents with query $createBulkDocuments(); @@ -4962,7 +4962,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4979,7 +4979,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); // SUCCESS: Delete Documents with limit query $createBulkDocuments(); @@ -5002,7 +5002,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['modified']); + $this->assertEquals(2, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5019,7 +5019,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(9, $response['body']['modified']); + $this->assertEquals(9, $response['body']['total']); // SUCCESS: Delete Documents with offset query $createBulkDocuments(); @@ -5042,7 +5042,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5064,7 +5064,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); // SUCCESS: Delete over 1k documents $createBulkDocuments(1000); @@ -5083,7 +5083,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1001, $response['body']['modified']); + $this->assertEquals(1001, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 57cd5115c9..86d93779e8 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -1000,7 +1000,7 @@ class DatabasesCustomClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 27390de7a2..b3e7280b04 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -650,6 +650,7 @@ class RealtimeCustomClientTest extends Scope $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; + $documentIds = []; $client = $this->getWebsocket(['documents', 'collections'], [ 'origin' => 'http://localhost', @@ -739,6 +740,7 @@ class RealtimeCustomClientTest extends Scope $response = json_decode($client->receive(), true); $documentId = $document['body']['$id']; + $documentIds[] = $documentId; $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); @@ -882,35 +884,66 @@ class RealtimeCustomClientTest extends Scope $client->receive(); - $documentId = $document['body']['$id']; + $documentIds[] = $document['body']['$id']; + + $document2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Bradley Cooper' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $client->receive(); + + $documentIds[] = $document2['body']['$id']; $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $response = json_decode($client->receive(), true); + while (!empty($documentIds)) { + $response = json_decode($client->receive(), true); - $this->assertArrayHasKey('type', $response); - $this->assertArrayHasKey('data', $response); - $this->assertEquals('event', $response['type']); - $this->assertNotEmpty($response['data']); - $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); - $this->assertContains('documents', $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}", $response['data']['events']); - $this->assertContains("databases.*", $response['data']['events']); - $this->assertNotEmpty($response['data']['payload']); + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(3, $response['data']['channels']); + $this->assertNotEmpty($response['data']['payload']); + + if (!in_array($response['data']['payload']['$id'], $documentIds)) { + $this->fail('Document ID not found in the payload'); + } + $documentId = $response['data']['payload']['$id']; + + $this->assertContains('documents', $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + unset($documentIds[array_search($documentId, $documentIds)]); + } $client->close(); } From 90c4bad826baa8163326bc2085550edd23a9cf64 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 22 Nov 2024 10:44:19 +0900 Subject: [PATCH 023/161] Run Linter --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 73098eda15..108e98256a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3874,7 +3874,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') // DB Storage Calculation $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection - + // Trigger all events, we do this manually since we have to trigger multiple. foreach ($documents as $document) { $document->setAttribute('$databaseId', $database->getId()); From 67b95c4b39c892c51fec1a3b770ebabdf11e496c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 22 Nov 2024 11:07:05 +0900 Subject: [PATCH 024/161] Update API Signature to DB Lib and get realtime/events working --- app/controllers/api/databases.php | 34 +- composer.json | 2 +- composer.lock | 2155 ++++++++++++++--- .../e2e/Services/Databases/DatabasesBase.php | 10 +- .../Databases/DatabasesCustomClientTest.php | 4 +- .../Realtime/RealtimeCustomClientTest.php | 73 + 6 files changed, 1939 insertions(+), 339 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4514943745..1da2bd276d 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,6 +4,7 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; +use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; @@ -3705,7 +3706,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.description', '/docs/references/databases/update-documents.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BULK_OPERATION) + ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -3716,8 +3717,9 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->inject('mode') - ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, string $mode) { + ->inject('queueForRealtime') + ->inject('project') + ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Realtime $queueForRealtime, Document $project) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array if (empty($data) && \is_null($permissions)) { @@ -3774,7 +3776,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } $partialDocument = new Document($data); - $modified = $dbForProject->withRequestTimestamp( + $documents = $dbForProject->withRequestTimestamp( $requestTimestamp, fn () => $dbForProject->updateDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), @@ -3789,9 +3791,29 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('collection', $collection) ->setContext('database', $database); + // Trigger all events, we do this manually since we have to trigger multiple. + foreach ($documents as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + + $queueForEvents + ->setProject($project) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].update') + ->setParam('documentId', $document->getId()) + ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) + ->trigger(); + + if ($project->getId() !== 'console') { + $queueForRealtime + ->from($queueForEvents) + ->trigger(); + } + } + $response->dynamic(new Document([ - 'modified' => $modified - ]), Response::MODEL_BULK_OPERATION); + 'total' => \count($documents), + 'documents' => $documents + ]), Response::MODEL_DOCUMENT_LIST); }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') diff --git a/composer.json b/composer.json index 237e2e9562..b9cd44d1c4 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.17", + "utopia-php/database": "0.53.23", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 8f9d71ea59..c68ab68db0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "971e88c7387ffd92d755772e0f4e7805", + "content-hash": "28e6c599d5da0991d373aba9f3988309", "packages": [ { "name": "adhocore/jwt", @@ -277,6 +277,66 @@ }, "time": "2024-07-15T13:18:35+00:00" }, + { + "name": "brick/math", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.12.1" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-11-29T23:19:16+00:00" + }, { "name": "chillerlan/php-qrcode", "version": "4.3.4", @@ -422,6 +482,87 @@ ], "time": "2024-07-17T01:04:28+00:00" }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.2", @@ -567,29 +708,73 @@ "time": "2024-05-03T06:31:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "name": "google/protobuf", + "version": "v4.28.3", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", + "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + }, + "time": "2024-10-22T22:27:17+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -621,9 +806,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "league/csv", @@ -906,6 +1091,553 @@ }, "time": "2019-09-10T13:16:29+00:00" }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "nyholm/psr7-server", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7-server.git", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "nyholm/nsa": "^1.1", + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nyholm\\Psr7Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "Helper classes to handle PSR-7 server requests", + "homepage": "http://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" + }, + { + "name": "open-telemetry/api", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/542064815d38a6df55af7957cd6f1d7d967c99c6", + "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6", + "shasum": "" + }, + "require": { + "open-telemetry/context": "^1.0", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" + }, + "conflict": { + "open-telemetry/sdk": "<=1.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-15T22:42:37+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-21T00:29:20+00:00" + }, + { + "name": "open-telemetry/exporter-otlp", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/exporter-otlp.git", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "shasum": "" + }, + "require": { + "open-telemetry/api": "^1.0", + "open-telemetry/gen-otlp-protobuf": "^1.1", + "open-telemetry/sdk": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "_register.php" + ], + "psr-4": { + "OpenTelemetry\\Contrib\\Otlp\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "OTLP exporter for OpenTelemetry.", + "keywords": [ + "Metrics", + "exporter", + "gRPC", + "http", + "opentelemetry", + "otel", + "otlp", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-04-30T18:28:30+00:00" + }, + { + "name": "open-telemetry/gen-otlp-protobuf", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", + "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.22 || ^4.0", + "php": "^8.0" + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": [ + "Metrics", + "apm", + "gRPC", + "logging", + "opentelemetry", + "otel", + "otlp", + "protobuf", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-30T11:49:49+00:00" + }, + { + "name": "open-telemetry/sdk", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nyholm/psr7-server": "^1.1", + "open-telemetry/api": "~1.0 || ~1.1", + "open-telemetry/context": "^1.0", + "open-telemetry/sem-conv": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "ramsey/uuid": "^3.0 || ^4.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php82": "^1.26", + "tbachert/spi": "^1.0.1" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations", + "open-telemetry/sdk-configuration": "File-based OpenTelemetry SDK configuration" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + }, + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + } + }, + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-10-18T21:01:35+00:00" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/1dba705fea74bc0718d04be26090e3697e56f4e6", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-28T09:20:31+00:00" + }, { "name": "paragonie/constant_time_encoding", "version": "v2.7.0", @@ -973,6 +1705,85 @@ }, "time": "2024-05-08T12:18:48+00:00" }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.9.1", @@ -1054,6 +1865,450 @@ ], "time": "2023-11-25T22:23:28+00:00" }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, { "name": "spomky-labs/otphp", "version": "v10.0.3", @@ -1129,6 +2384,245 @@ }, "time": "2022-03-17T08:00:35+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/http-client", + "version": "v7.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "^3.4.1", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.1.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:40:27+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "20414d96f391677bf80078aa55baece78b82647d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", + "reference": "20414d96f391677bf80078aa55baece78b82647d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.31.0", @@ -1289,6 +2783,217 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php82", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "5d2ed36f7734637dacc025f179698031951b1692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692", + "reference": "5d2ed36f7734637dacc025f179698031951b1692", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "tbachert/spi", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Nevay/spi.git", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nevay/spi/zipball/2ddfaf815dafb45791a61b08170de8d583c16062", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "composer/semver": "^1.0 || ^2.0 || ^3.0", + "php": "^8.1" + }, + "require-dev": { + "composer/composer": "^2.0", + "infection/infection": "^0.27.9", + "phpunit/phpunit": "^10.5", + "psalm/phar": "^5.18" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-main": "0.2.x-dev" + }, + "class": "Nevay\\SPI\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Nevay\\SPI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Service provider loading facility", + "keywords": [ + "service provider" + ], + "support": { + "issues": "https://github.com/Nevay/spi/issues", + "source": "https://github.com/Nevay/spi/tree/v1.0.2" + }, + "time": "2024-10-04T16:36:12+00:00" + }, { "name": "thecodingmachine/safe", "version": "v2.5.0", @@ -1770,16 +3475,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.17", + "version": "0.53.23", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a" + "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/07e3e5a1f5dbf9b351aab138085bde06611b305a", - "reference": "07e3e5a1f5dbf9b351aab138085bde06611b305a", + "url": "https://api.github.com/repos/utopia-php/database/zipball/b5bd17ef34f37018dca06cb764387e1e40bfe63a", + "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a", "shasum": "" }, "require": { @@ -1820,9 +3525,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.17" + "source": "https://github.com/utopia-php/database/tree/0.53.23" }, - "time": "2024-11-06T09:20:59+00:00" + "time": "2024-11-21T05:07:44+00:00" }, { "name": "utopia-php/domains", @@ -1972,21 +3677,22 @@ }, { "name": "utopia-php/framework", - "version": "0.33.11", + "version": "0.33.14", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466" + "reference": "45a5a2db3602fa054096f378482c7da9936f5850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/354ff0d23bfc6e82bea0fe8e89e115cff1af8466", - "reference": "354ff0d23bfc6e82bea0fe8e89e115cff1af8466", + "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", + "reference": "45a5a2db3602fa054096f378482c7da9936f5850", "shasum": "" }, "require": { - "php": ">=8.0", - "utopia-php/compression": "0.1.*" + "php": ">=8.1", + "utopia-php/compression": "0.1.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^1.2", @@ -2012,9 +3718,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.11" + "source": "https://github.com/utopia-php/http/tree/0.33.14" }, - "time": "2024-11-08T18:47:43+00:00" + "time": "2024-11-20T12:39:10+00:00" }, { "name": "utopia-php/image", @@ -2542,22 +4248,23 @@ }, { "name": "utopia-php/queue", - "version": "0.7.2", + "version": "0.7.3", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6" + "reference": "16074a98ee7d6212bc1228de200e13db470c098a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/40fdd9799d0a11dd33fca06f8223032a47dce2f6", - "reference": "40fdd9799d0a11dd33fca06f8223032a47dce2f6", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/16074a98ee7d6212bc1228de200e13db470c098a", + "reference": "16074a98ee7d6212bc1228de200e13db470c098a", "shasum": "" }, "require": { - "php": ">=8.0", + "php": ">=8.1", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^0.2.3", @@ -2597,9 +4304,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.2" + "source": "https://github.com/utopia-php/queue/tree/0.7.3" }, - "time": "2024-11-11T10:04:02+00:00" + "time": "2024-11-13T12:47:48+00:00" }, { "name": "utopia-php/registry", @@ -2815,6 +4522,56 @@ }, "time": "2024-10-09T14:44:01+00:00" }, + { + "name": "utopia-php/telemetry", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/telemetry.git", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "shasum": "" + }, + "require": { + "ext-opentelemetry": "*", + "ext-protobuf": "*", + "nyholm/psr7": "^1.8", + "open-telemetry/exporter-otlp": "^1.1", + "open-telemetry/sdk": "^1.1", + "php": ">=8.0", + "symfony/http-client": "^7.1" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "keywords": [ + "framework", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/telemetry/issues", + "source": "https://github.com/utopia-php/telemetry/tree/0.1.0" + }, + "time": "2024-11-13T10:29:53+00:00" + }, { "name": "utopia-php/vcs", "version": "0.8.5", @@ -3049,16 +4806,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.24", + "version": "0.39.25", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8" + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/412451c87f6ef17e24e9a5cf41721043d74c60c8", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5b5323636a8d75a1c4faaae9728098dd6a6a47d1", + "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1", "shasum": "" }, "require": { @@ -3066,7 +4823,7 @@ "ext-json": "*", "ext-mbstring": "*", "matthiasmullie/minify": "1.3.*", - "php": ">=8.0", + "php": ">=8.3", "twig/twig": "3.14.*" }, "require-dev": { @@ -3094,9 +4851,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.24" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.25" }, - "time": "2024-10-09T19:13:27+00:00" + "time": "2024-11-08T10:16:34+00:00" }, { "name": "doctrine/annotations", @@ -3370,16 +5127,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -3432,7 +5189,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "matthiasmullie/minify", @@ -4173,26 +5930,27 @@ }, { "name": "phpspec/prophecy", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" @@ -4236,9 +5994,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2024-02-29T11:52:51+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -4758,109 +6516,6 @@ }, "time": "2021-02-03T23:26:27+00:00" }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.2", @@ -5922,16 +7577,16 @@ }, { "name": "symfony/console", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -5995,7 +7650,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.7" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -6011,74 +7666,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/filesystem", @@ -6593,16 +8181,16 @@ }, { "name": "symfony/process", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", + "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", "shasum": "" }, "require": { @@ -6634,7 +8222,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.7" + "source": "https://github.com/symfony/process/tree/v7.1.8" }, "funding": [ { @@ -6650,103 +8238,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:12+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -6804,7 +8309,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -6820,7 +8325,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "textalk/websocket", diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index ea62ad2efc..e6923ca1af 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4889,7 +4889,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4920,7 +4920,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4954,7 +4954,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertCount(5, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -4980,7 +4980,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertCount(5, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5006,7 +5006,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 745a97caf3..e106253cfb 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -1009,7 +1009,7 @@ class DatabasesCustomClientTest extends Scope ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertCount(6, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -1139,7 +1139,7 @@ class DatabasesCustomClientTest extends Scope ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1, $response['body']['modified']); + $this->assertCount(1, $response['body']['documents']); $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 616f309fd2..316999b9b9 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -650,6 +650,7 @@ class RealtimeCustomClientTest extends Scope $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; + $documentIds = []; $client = $this->getWebsocket(['documents', 'collections'], [ 'origin' => 'http://localhost', @@ -739,6 +740,7 @@ class RealtimeCustomClientTest extends Scope $response = json_decode($client->receive(), true); $documentId = $document['body']['$id']; + $documentIds[] = $documentId; $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); @@ -862,6 +864,77 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']['payload']); $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); + /** + * Test Documents Update + */ + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Bradley Cooper' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $client->receive(); + $documentIds[] = $document['body']['$id']; + + $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'name' => 'Bradley Cooper 2' + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $updateDocumentIds = $documentIds; + while (!empty($updateDocumentIds)) { + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(3, $response['data']['channels']); + $this->assertNotEmpty($response['data']['payload']); + + if (!in_array($response['data']['payload']['$id'], $updateDocumentIds)) { + $this->fail('Document ID not found in the payload'); + } + $documentId = $response['data']['payload']['$id']; + + $this->assertContains('documents', $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + unset($updateDocumentIds[array_search($documentId, $updateDocumentIds)]); + } + $client->close(); } From 54260b5a9a24ececf869a0de6fdc2bca1d4ae5c3 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 22 Nov 2024 11:51:17 +0900 Subject: [PATCH 025/161] Use new API Spec and get realtime/events working --- app/config/specs/open-api3-latest-client.json | 19 +-- .../specs/open-api3-latest-console.json | 19 +-- app/config/specs/open-api3-latest-server.json | 19 +-- app/config/specs/swagger2-latest-client.json | 19 +-- app/config/specs/swagger2-latest-console.json | 19 +-- app/config/specs/swagger2-latest-server.json | 19 +-- app/controllers/api/databases.php | 101 +++++++------ app/controllers/shared/api.php | 6 - .../Realtime/RealtimeCustomClientTest.php | 134 ++++++++++++++++++ 9 files changed, 207 insertions(+), 148 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index a79b4e9fda..0409fd9009 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4540,11 +4540,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/bulkOperation" + "$ref": "#\/components\/schemas\/document" } } } @@ -9869,21 +9869,6 @@ "identifier", "expired" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 4996a55599..2925ddd4ce 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8109,11 +8109,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/bulkOperation" + "$ref": "#\/components\/schemas\/document" } } } @@ -38731,21 +38731,6 @@ "projectId", "displayName" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index a33cde6511..20e95362fb 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7636,11 +7636,11 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/bulkOperation" + "$ref": "#\/components\/schemas\/document" } } } @@ -27101,21 +27101,6 @@ "identifier", "expired" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "securitySchemes": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 46ebf3c837..0c9ad9aa25 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4712,9 +4712,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "schema": { - "$ref": "#\/definitions\/bulkOperation" + "$ref": "#\/definitions\/document" } } }, @@ -10052,21 +10052,6 @@ "identifier", "expired" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index ac6f1dba63..7f25544918 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8268,9 +8268,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "schema": { - "$ref": "#\/definitions\/bulkOperation" + "$ref": "#\/definitions\/document" } } }, @@ -39299,21 +39299,6 @@ "projectId", "displayName" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 146e3d29b6..fd41c9cf50 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7782,9 +7782,9 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "BulkOperation", + "description": "Document", "schema": { - "$ref": "#\/definitions\/bulkOperation" + "$ref": "#\/definitions\/document" } } }, @@ -27594,21 +27594,6 @@ "identifier", "expired" ] - }, - "bulkOperation": { - "description": "BulkOperation", - "type": "object", - "properties": { - "modified": { - "type": "integer", - "description": "Total number of documents affected by the operation.", - "x-example": 64, - "format": "int32" - } - }, - "required": [ - "modified" - ] } }, "externalDocs": { diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e118c0acdb..1aa3a1f506 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,6 +4,7 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; +use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; @@ -2844,7 +2845,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default']) ->desc('Create document') ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'document.create') @@ -2872,8 +2872,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForUsage') + ->inject('queueForRealtime') + ->inject('project') ->inject('mode') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, string $mode) { + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, Realtime $queueForRealtime, Document $project, string $mode) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array $isBulk = true; @@ -3069,49 +3071,68 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('collection', $collection) ->setContext('database', $database); + // Add $collectionId and $databaseId for all documents + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { + $document->removeAttribute('$collection'); + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + if (!\is_array($related)) { + $related = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + ); + + foreach ($related as $relation) { + if ($relation instanceof Document) { + $processDocument($relatedCollection, $relation); + } + } + } + }; + + foreach ($documents as $document) { + $processDocument($collection, $document); + + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + + $queueForEvents + ->setProject($project) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create') + ->setParam('documentId', $document->getId()) + ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) + ->trigger(); + + if ($project->getId() !== 'console') { + $queueForRealtime + ->from($queueForEvents) + ->trigger(); + } + } + if ($isBulk) { $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic(new Document([ - 'modified' => count($documents), - ]), Response::MODEL_BULK_OPERATION); + 'total' => count($documents), + 'documents' => $documents, + ]), Response::MODEL_DOCUMENT_LIST); } else { - // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { - $document->removeAttribute('$collection'); - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - - $queueForEvents - ->setParam('documentId', $document->getId()); - }; $document = $documents[0]; $processDocument($collection, $document); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index e346f85dd3..f5921bf6e8 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -94,10 +94,6 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que $value = -1; } - if ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = \count($document->getAttribute('modified', [])); - } - switch (true) { case $document->getCollection() === 'teams': $queueForUsage @@ -501,8 +497,6 @@ App::init() $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) - ->on(Database::EVENT_DOCUMENTS_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) - ->on(Database::EVENT_DOCUMENTS_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $document, $response, diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 616f309fd2..262769189e 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -865,6 +865,140 @@ class RealtimeCustomClientTest extends Scope $client->close(); } + //TODO: Move all bulk operations into this test + public function testChannelDatabaseBulkOperations() + { + $user = $this->getUser(); + $session = $user['session'] ?? ''; + $projectId = $this->getProject()['$id']; + $documentIds = []; + + $client = $this->getWebsocket(['documents', 'collections'], [ + 'origin' => 'http://localhost', + 'cookie' => 'a_session_' . $projectId . '=' . $session + ]); + + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(2, $response['data']['channels']); + $this->assertContains('documents', $response['data']['channels']); + $this->assertContains('collections', $response['data']['channels']); + $this->assertNotEmpty($response['data']['user']); + $this->assertEquals($user['$id'], $response['data']['user']['$id']); + + /** + * Database Create + */ + $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'databaseId' => ID::unique(), + 'name' => 'Actors DB', + ]); + + $databaseId = $database['body']['$id']; + + /** + * Collection Create + */ + $actors = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Actors', + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + ], + 'documentSecurity' => true, + ]); + + $actorsId = $actors['body']['$id']; + + $name = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/attributes/string', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'name', + 'size' => 256, + 'required' => true, + ]); + + $this->assertEquals($name['headers']['status-code'], 202); + $this->assertEquals($name['body']['key'], 'name'); + $this->assertEquals($name['body']['type'], 'string'); + $this->assertEquals($name['body']['size'], 256); + $this->assertEquals($name['body']['required'], true); + + sleep(2); + + /** + * Bulk Document Create + */ + $documents = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => array_map(function ($id) use (&$documentIds) { + $documentIds[] = $id; + return [ + '$id' => $id, + 'name' => 'Chris Evans', + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]; + }, [ID::unique(), ID::unique(), ID::unique(), ID::unique(), ID::unique()]), + ]); + + $createDocumentIds = $documentIds; + + while (!empty($createDocumentIds)) { + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('event', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertArrayHasKey('timestamp', $response['data']); + $this->assertCount(3, $response['data']['channels']); + $this->assertNotEmpty($response['data']['payload']); + + if (!in_array($response['data']['payload']['$id'], $documentIds)) { + $this->fail('Document ID not found in the payload'); + } + $documentId = $response['data']['payload']['$id']; + + $this->assertContains('documents', $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); + $this->assertContains("databases.{$databaseId}", $response['data']['events']); + $this->assertContains("databases.*", $response['data']['events']); + + unset($createDocumentIds[array_search($documentId, $createDocumentIds)]); + } + } + public function testChannelDatabaseCollectionPermissions() { $user = $this->getUser(); From 4e5ad33d73ce50c27f7512db4c091f9b8fe64ecf Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 14:29:51 +0900 Subject: [PATCH 026/161] Update app/controllers/api/databases.php Co-authored-by: Jake Barnby --- app/controllers/api/databases.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 108e98256a..f19d9239a4 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3895,8 +3895,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') } $response->dynamic(new Document([ - "total" => \count($documents), - "documents" => $documents, + 'total' => \count($documents), + 'documents' => $documents, ]), Response::MODEL_DOCUMENT_LIST); }); From 675227d25a20cc2424b9d2a7694efed7d0c2e7b5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 14:34:23 +0900 Subject: [PATCH 027/161] Address Comments --- app/controllers/shared/api.php | 5 -- .../Utopia/Response/Model/BulkOperation.php | 52 ------------------- 2 files changed, 57 deletions(-) delete mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 349e88e16b..394a420c3f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -91,10 +91,6 @@ $eventDatabaseListener = function (Document $document, Response $response, Event $usageDatabaseListener = function (string $event, Document $document, Usage $queueForUsage) { $value = 1; - if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * count($document->getAttribute('$ids', [])); - } - if ($event === Database::EVENT_DOCUMENT_DELETE) { $value = -1; } @@ -502,7 +498,6 @@ App::init() $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) - ->on(Database::EVENT_DOCUMENTS_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $document, $response, diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php deleted file mode 100644 index afcc8ef2ab..0000000000 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ /dev/null @@ -1,52 +0,0 @@ -addRule('$collectionId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Collection ID.', - 'default' => '', - 'example' => '5e5ea5c15117e', - ]) - ->addRule('$databaseId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Database ID.', - 'default' => '', - 'example' => '5e5ea5c15117e', - ]) - ->addRule('modified', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Total number of documents affected by the operation.', - 'default' => 0, - 'example' => 64, - ]); - } - - /** - * Get Name - * - * @return string - */ - public function getName(): string - { - return 'BulkOperation'; - } - - /** - * Get Type - * - * @return string - */ - public function getType(): string - { - return Response::MODEL_BULK_OPERATION; - } -} From e1230f746589374005251297ae6e6ec44cd63229 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 14:45:21 +0900 Subject: [PATCH 028/161] Address Comments --- app/controllers/api/databases.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 1aa3a1f506..2716600313 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3072,7 +3072,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('database', $database); // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { + $processDocument = function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -3108,9 +3108,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') foreach ($documents as $document) { $processDocument($collection, $document); - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - $queueForEvents ->setProject($project) ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create') @@ -3133,13 +3130,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') 'documents' => $documents, ]), Response::MODEL_DOCUMENT_LIST); } else { - - $document = $documents[0]; - $processDocument($collection, $document); - $response ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($document, Response::MODEL_DOCUMENT); + ->dynamic($documents[0], Response::MODEL_DOCUMENT); } $queueForUsage @@ -3223,7 +3216,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') return false; } - $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); From 19194dabc0bf0908f400d4a82bced9ff98f1c473 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 14:53:01 +0900 Subject: [PATCH 029/161] Remove Bulk Operation Model --- src/Appwrite/Utopia/Response.php | 3 -- .../Utopia/Response/Model/BulkOperation.php | 40 ------------------- 2 files changed, 43 deletions(-) delete mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 53aa2389ed..6cc2639f51 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -31,7 +31,6 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; -use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -152,7 +151,6 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; - public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; @@ -484,7 +482,6 @@ class Response extends SwooleResponse ->setModel(new Migration()) ->setModel(new MigrationReport()) ->setModel(new MigrationFirebaseProject()) - ->setModel(new BulkOperation()) // Tests (keep last) ->setModel(new Mock()); diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php deleted file mode 100644 index 7c6d7f6fe9..0000000000 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ /dev/null @@ -1,40 +0,0 @@ -addRule('modified', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Total number of documents affected by the operation.', - 'default' => 0, - 'example' => 64, - ]); - } - - /** - * Get Name - * - * @return string - */ - public function getName(): string - { - return 'BulkOperation'; - } - - /** - * Get Type - * - * @return string - */ - public function getType(): string - { - return Response::MODEL_BULK_OPERATION; - } -} From 558f7f06b47e76a15abe60e77af467afdf8ba3d4 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 14:53:35 +0900 Subject: [PATCH 030/161] Fix Missing Model --- src/Appwrite/Utopia/Response.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 53aa2389ed..6cc2639f51 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -31,7 +31,6 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; -use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -152,7 +151,6 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; - public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; @@ -484,7 +482,6 @@ class Response extends SwooleResponse ->setModel(new Migration()) ->setModel(new MigrationReport()) ->setModel(new MigrationFirebaseProject()) - ->setModel(new BulkOperation()) // Tests (keep last) ->setModel(new Mock()); From 90521c6bd7fbcceba7cb5e82267ca88859f517ba Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 15:02:36 +0900 Subject: [PATCH 031/161] Update database library version --- composer.json | 2 +- composer.lock | 51 ++++++++++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index fd9150b236..46d82e9d13 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.22", + "utopia-php/database": "0.53.24", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index ff388f2ef0..b98586161f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "71370f3036cd4e3d2e19783319850e0c", + "content-hash": "ae8931fbd64214cd6f1a8688b37f696d", "packages": [ { "name": "adhocore/jwt", @@ -3475,16 +3475,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.22", + "version": "0.53.24", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "1f7cbd456f09f66049ede1cab0815775eb946dbf" + "reference": "19231e6aeebb17cc6a8590dfbcd73dca2c5c9219" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/1f7cbd456f09f66049ede1cab0815775eb946dbf", - "reference": "1f7cbd456f09f66049ede1cab0815775eb946dbf", + "url": "https://api.github.com/repos/utopia-php/database/zipball/19231e6aeebb17cc6a8590dfbcd73dca2c5c9219", + "reference": "19231e6aeebb17cc6a8590dfbcd73dca2c5c9219", "shasum": "" }, "require": { @@ -3525,9 +3525,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.22" + "source": "https://github.com/utopia-php/database/tree/0.53.24" }, - "time": "2024-11-18T03:58:10+00:00" + "time": "2024-11-25T04:27:54+00:00" }, { "name": "utopia-php/domains", @@ -3677,16 +3677,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.13", + "version": "0.33.14", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4" + "reference": "45a5a2db3602fa054096f378482c7da9936f5850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/4ecab88e424a136ffaa27cdf3db3c60f76c777e4", - "reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4", + "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", + "reference": "45a5a2db3602fa054096f378482c7da9936f5850", "shasum": "" }, "require": { @@ -3718,9 +3718,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.13" + "source": "https://github.com/utopia-php/http/tree/0.33.14" }, - "time": "2024-11-15T08:37:31+00:00" + "time": "2024-11-20T12:39:10+00:00" }, { "name": "utopia-php/image", @@ -5127,16 +5127,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -5189,7 +5189,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "matthiasmullie/minify", @@ -5930,26 +5930,27 @@ }, { "name": "phpspec/prophecy", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" @@ -5993,9 +5994,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2024-02-29T11:52:51+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpstan/phpdoc-parser", From 2e60698ec1860480a9a6f71cff164957b8c3ffe0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 15:21:56 +0900 Subject: [PATCH 032/161] Fix double event execution on document creation --- app/controllers/api/databases.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 2716600313..2be89a511a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3122,6 +3122,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } } + // We don't want to double trigger events + $queueForEvents->setEvent(''); + if ($isBulk) { $response ->setStatusCode(Response::STATUS_CODE_CREATED) From e1fffa775e4a4169a204de4e0dc66bc164cafb9f Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 15:23:22 +0900 Subject: [PATCH 033/161] Fix Tests --- tests/e2e/Services/Databases/DatabasesBase.php | 4 ++-- tests/e2e/Services/Databases/DatabasesCustomClientTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 62b5118283..5379fe11b7 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4875,7 +4875,7 @@ trait DatabasesBase ]); $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals(3, $response['body']['modified']); + $this->assertCount(3, $response['body']['documents']); $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ 'content-type' => 'application/json', @@ -5054,7 +5054,7 @@ trait DatabasesBase ]); $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['modified']); + $this->assertCount(2, $response['body']['documents']); $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 51e679c86e..56922b602b 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -1077,6 +1077,6 @@ class DatabasesCustomClientTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $this->assertEquals(3, $response['body']['modified']); + $this->assertCount(3, $response['body']['documents']); } } From 9d652d9e792427a8ba205dfd9fa7a7b968de5b7e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 16:08:50 +0900 Subject: [PATCH 034/161] Remove double realtime --- app/controllers/api/databases.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 2be89a511a..a06ae5c60d 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3124,6 +3124,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') // We don't want to double trigger events $queueForEvents->setEvent(''); + $queueForRealtime->setEvent(''); if ($isBulk) { $response From 2b08db9a38a77436c82eea41438843f0e8797f1d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 25 Nov 2024 16:22:02 +0900 Subject: [PATCH 035/161] Address Comments --- app/controllers/api/databases.php | 50 ++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f19d9239a4..17d8f98144 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3876,10 +3876,55 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection // Trigger all events, we do this manually since we have to trigger multiple. - foreach ($documents as $document) { + $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database): bool { + if ($document->isEmpty()) { + return false; + } + $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + if (!\is_array($related)) { + $relations = [$related]; + } else { + $relations = $related; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId)); + + foreach ($relations as $index => $doc) { + if ($doc instanceof Document) { + if (!$processDocument($relatedCollection, $doc)) { + unset($relations[$index]); + } + } + } + + if (\is_array($related)) { + $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); + } elseif (empty($relations)) { + $document->setAttribute($relationship->getAttribute('key'), null); + } + } + + return true; + }); + + foreach ($documents as $document) { + $processDocument($collection, $document); + $queueForEvents ->setProject($project) ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].delete') @@ -3894,6 +3939,9 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') } } + $queueForEvents->setEvent(''); + $queueForRealtime->setEvent(''); + $response->dynamic(new Document([ 'total' => \count($documents), 'documents' => $documents, From 104a9b60740b4c8ab155c5ac927d6702eb658290 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 28 Nov 2024 16:29:22 +0900 Subject: [PATCH 036/161] Remove realtime support for bulk operations --- app/controllers/api/databases.php | 27 +--- app/init.php | 1 + tests/benchmarks/bulk-operations.js | 32 +++++ .../Realtime/RealtimeCustomClientTest.php | 136 +----------------- 4 files changed, 41 insertions(+), 155 deletions(-) create mode 100644 tests/benchmarks/bulk-operations.js diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index a06ae5c60d..971faf82c6 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2865,7 +2865,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of documents data as JSON object.', true) + ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'Array of documents data as JSON object.', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') @@ -3072,7 +3072,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('database', $database); // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, $queueForEvents) { + $processDocument = function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database) { $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -3107,33 +3107,20 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') foreach ($documents as $document) { $processDocument($collection, $document); - - $queueForEvents - ->setProject($project) - ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create') - ->setParam('documentId', $document->getId()) - ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) - ->trigger(); - - if ($project->getId() !== 'console') { - $queueForRealtime - ->from($queueForEvents) - ->trigger(); - } } - // We don't want to double trigger events - $queueForEvents->setEvent(''); - $queueForRealtime->setEvent(''); - if ($isBulk) { $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic(new Document([ 'total' => count($documents), - 'documents' => $documents, + 'documents' => $documents ]), Response::MODEL_DOCUMENT_LIST); } else { + $queueForEvents + ->setParam('documentId', $document->getId()) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); + $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($documents[0], Response::MODEL_DOCUMENT); diff --git a/app/init.php b/app/init.php index c9ec2e0061..d2ba5df7b7 100644 --- a/app/init.php +++ b/app/init.php @@ -113,6 +113,7 @@ const APP_LIMIT_COMPRESSION = 20_000_000; //20MB const APP_LIMIT_ARRAY_PARAMS_SIZE = 100; // Default maximum of how many elements can there be in API parameter that expects array value const APP_LIMIT_ARRAY_LABELS_SIZE = 1000; // Default maximum of how many labels elements can there be in API parameter that expects array value const APP_LIMIT_ARRAY_ELEMENT_SIZE = 4096; // Default maximum length of element in array parameter represented by maximum URL length. +const APP_LIMIT_ARRAY_DOCUMENTS_SIZE = 10_000; // Default maximum of how many documents can be inserted in a single request const APP_LIMIT_SUBQUERY = 1000; const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period diff --git a/tests/benchmarks/bulk-operations.js b/tests/benchmarks/bulk-operations.js new file mode 100644 index 0000000000..dd077104e2 --- /dev/null +++ b/tests/benchmarks/bulk-operations.js @@ -0,0 +1,32 @@ +import { check } from "k6"; +import http from "k6/http"; + +const amount = 10000; +const databaseId = "674818e2000070c94275"; +const collectionId = "674818e3002f22da5fab"; + +const documents = Array(amount).fill({ + $id: "unique()", + name: "asd", +}); + +export default function () { + const payload = JSON.stringify({ + documents, + }); + + const res = http.post(`http://localhost/v1/databases/${databaseId}/collections/${collectionId}/documents`, + payload, + { + headers: { + "X-Appwrite-Key": "standard_fa89c4834660f39e95ca2c2996fe7dd4ff498725e37c09323234c009570c1719f1c10610bf3541cf9ead120c107e41397a4eae1c787c83bdf577857bbc5963341641c77f582cc41e11a0d50eb4c2e4b1fda74418a8b9a253d6e63008e33560ba35310b9dc2fed5f09ca599e646f744cc6308b8ccd27ff04f9e498ec5a5f2c3db", + "X-Appwrite-Project": "674818bc0017934d58dd", + "Content-Type": "application/json", + }, + } + ); + + check(res, { + "status is 200": (r) => r.status === 201, + }); +} diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 262769189e..dc003ca98f 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -865,142 +865,8 @@ class RealtimeCustomClientTest extends Scope $client->close(); } - //TODO: Move all bulk operations into this test - public function testChannelDatabaseBulkOperations() - { - $user = $this->getUser(); - $session = $user['session'] ?? ''; - $projectId = $this->getProject()['$id']; - $documentIds = []; - - $client = $this->getWebsocket(['documents', 'collections'], [ - 'origin' => 'http://localhost', - 'cookie' => 'a_session_' . $projectId . '=' . $session - ]); - - $response = json_decode($client->receive(), true); - - $this->assertArrayHasKey('type', $response); - $this->assertArrayHasKey('data', $response); - $this->assertEquals('connected', $response['type']); - $this->assertNotEmpty($response['data']); - $this->assertCount(2, $response['data']['channels']); - $this->assertContains('documents', $response['data']['channels']); - $this->assertContains('collections', $response['data']['channels']); - $this->assertNotEmpty($response['data']['user']); - $this->assertEquals($user['$id'], $response['data']['user']['$id']); - - /** - * Database Create - */ - $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'databaseId' => ID::unique(), - 'name' => 'Actors DB', - ]); - - $databaseId = $database['body']['$id']; - - /** - * Collection Create - */ - $actors = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Actors', - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - ], - 'documentSecurity' => true, - ]); - - $actorsId = $actors['body']['$id']; - - $name = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->assertEquals($name['headers']['status-code'], 202); - $this->assertEquals($name['body']['key'], 'name'); - $this->assertEquals($name['body']['type'], 'string'); - $this->assertEquals($name['body']['size'], 256); - $this->assertEquals($name['body']['required'], true); - - sleep(2); - - /** - * Bulk Document Create - */ - $documents = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => array_map(function ($id) use (&$documentIds) { - $documentIds[] = $id; - return [ - '$id' => $id, - 'name' => 'Chris Evans', - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]; - }, [ID::unique(), ID::unique(), ID::unique(), ID::unique(), ID::unique()]), - ]); - - $createDocumentIds = $documentIds; - - while (!empty($createDocumentIds)) { - $response = json_decode($client->receive(), true); - - $this->assertArrayHasKey('type', $response); - $this->assertArrayHasKey('data', $response); - $this->assertEquals('event', $response['type']); - $this->assertNotEmpty($response['data']); - $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); - $this->assertNotEmpty($response['data']['payload']); - - if (!in_array($response['data']['payload']['$id'], $documentIds)) { - $this->fail('Document ID not found in the payload'); - } - $documentId = $response['data']['payload']['$id']; - - $this->assertContains('documents', $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.create", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.create", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.create", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*.create", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}", $response['data']['events']); - $this->assertContains("databases.*", $response['data']['events']); - - unset($createDocumentIds[array_search($documentId, $createDocumentIds)]); - } - } - public function testChannelDatabaseCollectionPermissions() - { + { $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; From 5c895579ed7bfe2629758d5a6dcb546b3a77907c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 28 Nov 2024 17:24:53 +0900 Subject: [PATCH 037/161] Fix wrong params on feedback, disable debugging in compose file --- app/controllers/api/databases.php | 3 +++ docker-compose.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 971faf82c6..ea5af0e252 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -18,6 +18,7 @@ use Appwrite\Utopia\Response; use MaxMind\Db\Reader; use Utopia\App; use Utopia\Audit\Audit; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; @@ -3056,7 +3057,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') }, $documents); try { + $time = \microtime(true); $dbForProject->createDocuments('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documents); + Console::log('Document creation time: ' . (\microtime(true) - $time) . 's'); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); } catch (DuplicateException $e) { diff --git a/docker-compose.yml b/docker-compose.yml index 048178e60a..f0e517ef75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,6 +83,7 @@ services: - ./public:/usr/src/code/public - ./src:/usr/src/code/src - ./dev:/usr/src/code/dev + - ./vendor:/usr/src/code/vendor depends_on: - mariadb - redis From 00e3fe12f49692529dbd2f8ae9051e375bc32f92 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 28 Nov 2024 17:25:38 +0900 Subject: [PATCH 038/161] Revert "Fix wrong params on feedback, disable debugging in compose file" This reverts commit 5c895579ed7bfe2629758d5a6dcb546b3a77907c. --- app/controllers/api/databases.php | 3 --- docker-compose.yml | 1 - 2 files changed, 4 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index ea5af0e252..971faf82c6 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -18,7 +18,6 @@ use Appwrite\Utopia\Response; use MaxMind\Db\Reader; use Utopia\App; use Utopia\Audit\Audit; -use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; @@ -3057,9 +3056,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') }, $documents); try { - $time = \microtime(true); $dbForProject->createDocuments('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documents); - Console::log('Document creation time: ' . (\microtime(true) - $time) . 's'); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); } catch (DuplicateException $e) { diff --git a/docker-compose.yml b/docker-compose.yml index f0e517ef75..048178e60a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,7 +83,6 @@ services: - ./public:/usr/src/code/public - ./src:/usr/src/code/src - ./dev:/usr/src/code/dev - - ./vendor:/usr/src/code/vendor depends_on: - mariadb - redis From 1c0c8f0eb6bb428398f3b1477ce5a93615c52ec3 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 13:15:41 +0900 Subject: [PATCH 039/161] Run Formatter --- tests/benchmarks/bulk-operations.js | 6 +++--- tests/e2e/Services/Realtime/RealtimeCustomClientTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/benchmarks/bulk-operations.js b/tests/benchmarks/bulk-operations.js index dd077104e2..a60129735a 100644 --- a/tests/benchmarks/bulk-operations.js +++ b/tests/benchmarks/bulk-operations.js @@ -1,9 +1,9 @@ import { check } from "k6"; import http from "k6/http"; -const amount = 10000; -const databaseId = "674818e2000070c94275"; -const collectionId = "674818e3002f22da5fab"; +const amount = 100_000; +const databaseId = "674918b20017411b94b2"; +const collectionId = "674918b4002b46c47d5d"; const documents = Array(amount).fill({ $id: "unique()", diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index dc003ca98f..616f309fd2 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -866,7 +866,7 @@ class RealtimeCustomClientTest extends Scope } public function testChannelDatabaseCollectionPermissions() - { + { $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; From 2850879428d9211287a86f93256490e3341eb20b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 16:07:32 +0900 Subject: [PATCH 040/161] Remove Events for bulk updates --- app/controllers/api/databases.php | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 1da2bd276d..5dd7069341 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3692,7 +3692,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->desc('Update documents') ->groups(['api', 'database']) - ->label('event', 'databases.[databaseId].collections.[collectionId].documents.update') ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'documents.update') @@ -3719,7 +3718,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForEvents') ->inject('queueForRealtime') ->inject('project') - ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Realtime $queueForRealtime, Document $project) { + ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Document $project) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array if (empty($data) && \is_null($permissions)) { @@ -3785,31 +3784,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ) ); - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database); - - // Trigger all events, we do this manually since we have to trigger multiple. - foreach ($documents as $document) { - $document->setAttribute('$databaseId', $database->getId()); - $document->setAttribute('$collectionId', $collection->getId()); - - $queueForEvents - ->setProject($project) - ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].update') - ->setParam('documentId', $document->getId()) - ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) - ->trigger(); - - if ($project->getId() !== 'console') { - $queueForRealtime - ->from($queueForEvents) - ->trigger(); - } - } - $response->dynamic(new Document([ 'total' => \count($documents), 'documents' => $documents From 32c4debffc1e379df54d8e8d6b3ae97870ae95a9 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 16:40:19 +0900 Subject: [PATCH 041/161] Remove realtime/events from bulk operations and get usage events working --- app/controllers/api/databases.php | 28 +--- app/controllers/shared/api.php | 6 + composer.json | 2 +- composer.lock | 215 +++++++++++++++--------------- 4 files changed, 116 insertions(+), 135 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 17d8f98144..1a6259e587 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3839,7 +3839,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForRealtime') ->inject('queueForUsage') ->inject('project') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, Realtime $queueForRealtime, Usage $queueForUsage, Document $project) { + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Usage $queueForUsage, Document $project) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -3865,12 +3865,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ); }); - $queueForEvents - ->setParam('databaseId', $databaseId) - ->setParam('collectionId', $collection->getId()) - ->setContext('collection', $collection) - ->setContext('database', $database); - // DB Storage Calculation $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection @@ -3922,26 +3916,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') return true; }); - foreach ($documents as $document) { - $processDocument($collection, $document); - - $queueForEvents - ->setProject($project) - ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].delete') - ->setParam('documentId', $document->getId()) - ->setPayload($response->output($document, Response::MODEL_DOCUMENT)) - ->trigger(); - - if ($project->getId() !== 'console') { - $queueForRealtime - ->from($queueForEvents) - ->trigger(); - } - } - - $queueForEvents->setEvent(''); - $queueForRealtime->setEvent(''); - $response->dynamic(new Document([ 'total' => \count($documents), 'documents' => $documents, diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 394a420c3f..ed05429c8e 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -95,6 +95,12 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que $value = -1; } + if ($event === Database::EVENT_DOCUMENTS_DELETE) { + $value = -1 * count($document->getAttribute('modified', [])); + } else if ($event === Database::EVENT_DOCUMENTS_CREATE) { + $value = count($document->getAttribute('modified', [])); + } + switch (true) { case $document->getCollection() === 'teams': $queueForUsage diff --git a/composer.json b/composer.json index b9cd44d1c4..7b6d38b48d 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.23", + "utopia-php/database": "0.53.26", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index c68ab68db0..62dac10ab6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "28e6c599d5da0991d373aba9f3988309", + "content-hash": "fad37c607bf3a162dff5d0ee76d56984", "packages": [ { "name": "adhocore/jwt", @@ -157,16 +157,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.16.4", + "version": "0.16.5", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "7e4741337b9373f77210396e68eca539018cabd1" + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/7e4741337b9373f77210396e68eca539018cabd1", - "reference": "7e4741337b9373f77210396e68eca539018cabd1", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", "shasum": "" }, "require": { @@ -206,9 +206,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.16.4" + "source": "https://github.com/appwrite/runtimes/tree/0.16.5" }, - "time": "2024-10-26T10:39:59+00:00" + "time": "2024-11-25T15:17:06+00:00" }, { "name": "beberlei/assert", @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.28.3", + "version": "v4.29.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" }, - "time": "2024-10-22T22:27:17+00:00" + "time": "2024-11-27T18:37:40+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2343,9 +2343,9 @@ "type": "library", "extra": { "branch-alias": { - "v10.0": "10.0.x-dev", + "v8.3": "8.3.x-dev", "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" + "v10.0": "10.0.x-dev" } }, "autoload": { @@ -2386,16 +2386,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2449,30 +2449,31 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/http-client", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "amphp/amp": "<2.5", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2483,14 +2484,14 @@ "symfony/http-client-implementation": "3.0" }, "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/messenger": "^6.4|^7.0", @@ -2527,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.8" + "source": "https://github.com/symfony/http-client/tree/v7.2.0" }, "funding": [ { @@ -2543,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:27+00:00" + "time": "2024-11-29T08:22:02+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "20414d96f391677bf80078aa55baece78b82647d" + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -2605,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" }, "funding": [ { @@ -2621,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2861,16 +2862,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -2924,7 +2925,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -2940,7 +2941,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "tbachert/spi", @@ -3475,16 +3476,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.23", + "version": "0.53.26", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a" + "reference": "a351af62518b830044862c901fd06910046343b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/b5bd17ef34f37018dca06cb764387e1e40bfe63a", - "reference": "b5bd17ef34f37018dca06cb764387e1e40bfe63a", + "url": "https://api.github.com/repos/utopia-php/database/zipball/a351af62518b830044862c901fd06910046343b7", + "reference": "a351af62518b830044862c901fd06910046343b7", "shasum": "" }, "require": { @@ -3525,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.23" + "source": "https://github.com/utopia-php/database/tree/0.53.26" }, - "time": "2024-11-21T05:07:44+00:00" + "time": "2024-12-02T07:36:52+00:00" }, { "name": "utopia-php/domains", @@ -3928,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.12", + "version": "0.6.13", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", "shasum": "" }, "require": { @@ -3978,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.12" + "source": "https://github.com/utopia-php/migration/tree/0.6.13" }, - "time": "2024-11-12T00:31:53+00:00" + "time": "2024-11-26T13:57:53+00:00" }, { "name": "utopia-php/mongo", @@ -4362,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.6", + "version": "0.18.7", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071" + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/893ccf06e183f8ece2aed8dbf14d64d6ba036071", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", "shasum": "" }, "require": { @@ -4411,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.6" + "source": "https://github.com/utopia-php/storage/tree/0.18.7" }, - "time": "2024-11-06T09:58:50+00:00" + "time": "2024-11-28T11:10:53+00:00" }, { "name": "utopia-php/swoole", @@ -5127,16 +5128,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.2", + "version": "v1.18.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", "shasum": "" }, "require": { @@ -5147,13 +5148,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", + "friendsofphp/php-cs-fixer": "^3.65.0", + "illuminate/view": "^10.48.24", + "larastan/larastan": "^2.9.11", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -5189,7 +5190,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-20T09:33:46+00:00" + "time": "2024-11-26T15:34:00+00:00" }, { "name": "matthiasmullie/minify", @@ -7577,16 +7578,16 @@ }, { "name": "symfony/console", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", "shasum": "" }, "require": { @@ -7650,7 +7651,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.8" + "source": "https://github.com/symfony/console/tree/v7.2.0" }, "funding": [ { @@ -7666,20 +7667,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -7716,7 +7717,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.6" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -7732,20 +7733,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { @@ -7780,7 +7781,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.6" + "source": "https://github.com/symfony/finder/tree/v7.2.0" }, "funding": [ { @@ -7796,20 +7797,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:31:23+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -7847,7 +7848,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -7863,7 +7864,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8181,16 +8182,16 @@ }, { "name": "symfony/process", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -8222,7 +8223,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -8238,20 +8239,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -8309,7 +8310,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -8325,7 +8326,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:21+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "textalk/websocket", From 949347764a2e7b93b62f174b3a216b2de2592509 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 16:43:19 +0900 Subject: [PATCH 042/161] Add new database events --- app/controllers/shared/api.php | 6 + composer.json | 2 +- composer.lock | 215 +++++++++++++++++---------------- 3 files changed, 115 insertions(+), 108 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index f5921bf6e8..b5be4a05d2 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -94,6 +94,12 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que $value = -1; } + if ($event === Database::EVENT_DOCUMENTS_DELETE) { + $value = -1 * count($document->getAttribute('modified', [])); + } else if ($event === Database::EVENT_DOCUMENTS_CREATE) { + $value = count($document->getAttribute('modified', [])); + } + switch (true) { case $document->getCollection() === 'teams': $queueForUsage diff --git a/composer.json b/composer.json index 46d82e9d13..ff0e44550d 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.24", + "utopia-php/database": "0.53.26", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index b98586161f..62dac10ab6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ae8931fbd64214cd6f1a8688b37f696d", + "content-hash": "fad37c607bf3a162dff5d0ee76d56984", "packages": [ { "name": "adhocore/jwt", @@ -157,16 +157,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.16.4", + "version": "0.16.5", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "7e4741337b9373f77210396e68eca539018cabd1" + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/7e4741337b9373f77210396e68eca539018cabd1", - "reference": "7e4741337b9373f77210396e68eca539018cabd1", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", "shasum": "" }, "require": { @@ -206,9 +206,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.16.4" + "source": "https://github.com/appwrite/runtimes/tree/0.16.5" }, - "time": "2024-10-26T10:39:59+00:00" + "time": "2024-11-25T15:17:06+00:00" }, { "name": "beberlei/assert", @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.28.3", + "version": "v4.29.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" }, - "time": "2024-10-22T22:27:17+00:00" + "time": "2024-11-27T18:37:40+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2343,9 +2343,9 @@ "type": "library", "extra": { "branch-alias": { - "v10.0": "10.0.x-dev", + "v8.3": "8.3.x-dev", "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" + "v10.0": "10.0.x-dev" } }, "autoload": { @@ -2386,16 +2386,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2449,30 +2449,31 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/http-client", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "amphp/amp": "<2.5", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2483,14 +2484,14 @@ "symfony/http-client-implementation": "3.0" }, "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/messenger": "^6.4|^7.0", @@ -2527,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.8" + "source": "https://github.com/symfony/http-client/tree/v7.2.0" }, "funding": [ { @@ -2543,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:27+00:00" + "time": "2024-11-29T08:22:02+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "20414d96f391677bf80078aa55baece78b82647d" + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -2605,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" }, "funding": [ { @@ -2621,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2861,16 +2862,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -2924,7 +2925,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -2940,7 +2941,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "tbachert/spi", @@ -3475,16 +3476,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.24", + "version": "0.53.26", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "19231e6aeebb17cc6a8590dfbcd73dca2c5c9219" + "reference": "a351af62518b830044862c901fd06910046343b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/19231e6aeebb17cc6a8590dfbcd73dca2c5c9219", - "reference": "19231e6aeebb17cc6a8590dfbcd73dca2c5c9219", + "url": "https://api.github.com/repos/utopia-php/database/zipball/a351af62518b830044862c901fd06910046343b7", + "reference": "a351af62518b830044862c901fd06910046343b7", "shasum": "" }, "require": { @@ -3525,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.24" + "source": "https://github.com/utopia-php/database/tree/0.53.26" }, - "time": "2024-11-25T04:27:54+00:00" + "time": "2024-12-02T07:36:52+00:00" }, { "name": "utopia-php/domains", @@ -3928,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.12", + "version": "0.6.13", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", "shasum": "" }, "require": { @@ -3978,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.12" + "source": "https://github.com/utopia-php/migration/tree/0.6.13" }, - "time": "2024-11-12T00:31:53+00:00" + "time": "2024-11-26T13:57:53+00:00" }, { "name": "utopia-php/mongo", @@ -4362,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.6", + "version": "0.18.7", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071" + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/893ccf06e183f8ece2aed8dbf14d64d6ba036071", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", "shasum": "" }, "require": { @@ -4411,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.6" + "source": "https://github.com/utopia-php/storage/tree/0.18.7" }, - "time": "2024-11-06T09:58:50+00:00" + "time": "2024-11-28T11:10:53+00:00" }, { "name": "utopia-php/swoole", @@ -5127,16 +5128,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.2", + "version": "v1.18.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", "shasum": "" }, "require": { @@ -5147,13 +5148,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", + "friendsofphp/php-cs-fixer": "^3.65.0", + "illuminate/view": "^10.48.24", + "larastan/larastan": "^2.9.11", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -5189,7 +5190,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-20T09:33:46+00:00" + "time": "2024-11-26T15:34:00+00:00" }, { "name": "matthiasmullie/minify", @@ -7577,16 +7578,16 @@ }, { "name": "symfony/console", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", "shasum": "" }, "require": { @@ -7650,7 +7651,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.8" + "source": "https://github.com/symfony/console/tree/v7.2.0" }, "funding": [ { @@ -7666,20 +7667,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -7716,7 +7717,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.6" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -7732,20 +7733,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { @@ -7780,7 +7781,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.6" + "source": "https://github.com/symfony/finder/tree/v7.2.0" }, "funding": [ { @@ -7796,20 +7797,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:31:23+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -7847,7 +7848,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -7863,7 +7864,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8181,16 +8182,16 @@ }, { "name": "symfony/process", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -8222,7 +8223,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -8238,20 +8239,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -8309,7 +8310,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -8325,7 +8326,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:21+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "textalk/websocket", From 7b79642f4bfe0aff2719824b8fa2e30576170064 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 16:44:15 +0900 Subject: [PATCH 043/161] Run Linter --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index b5be4a05d2..3ef96298c6 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -96,7 +96,7 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que if ($event === Database::EVENT_DOCUMENTS_DELETE) { $value = -1 * count($document->getAttribute('modified', [])); - } else if ($event === Database::EVENT_DOCUMENTS_CREATE) { + } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { $value = count($document->getAttribute('modified', [])); } From 84ba7febe77a7c8905540360877505651b17414b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 16:45:03 +0900 Subject: [PATCH 044/161] Run Linter --- app/controllers/api/databases.php | 1 - app/controllers/shared/api.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 1a6259e587..8f1b7dc907 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,7 +4,6 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; -use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index ed05429c8e..87f25f1b07 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -97,7 +97,7 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que if ($event === Database::EVENT_DOCUMENTS_DELETE) { $value = -1 * count($document->getAttribute('modified', [])); - } else if ($event === Database::EVENT_DOCUMENTS_CREATE) { + } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { $value = count($document->getAttribute('modified', [])); } From 8f8c008e8b94bac88e3ab7b3c7fe3c2befec560e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 18:06:04 +0900 Subject: [PATCH 045/161] Fix params and usage --- app/controllers/api/databases.php | 2 -- app/controllers/shared/api.php | 4 ++-- composer.json | 2 +- composer.lock | 14 +++++++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 8f1b7dc907..0fcc431de9 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3834,8 +3834,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->inject('queueForEvents') - ->inject('queueForRealtime') ->inject('queueForUsage') ->inject('project') ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Usage $queueForUsage, Document $project) { diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 87f25f1b07..c5771fb921 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -96,9 +96,9 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que } if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * count($document->getAttribute('modified', [])); + $value = -1 * $document->getAttribute('modified', 0); } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = count($document->getAttribute('modified', [])); + $value = $document->getAttribute('modified', 0); } switch (true) { diff --git a/composer.json b/composer.json index 7b6d38b48d..0a81d5d70c 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.26", + "utopia-php/database": "0.53.27", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 62dac10ab6..be7dd88f82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fad37c607bf3a162dff5d0ee76d56984", + "content-hash": "0b299e8aaf279f410c6d81c1ad3a5031", "packages": [ { "name": "adhocore/jwt", @@ -3476,16 +3476,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.26", + "version": "0.53.27", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "a351af62518b830044862c901fd06910046343b7" + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/a351af62518b830044862c901fd06910046343b7", - "reference": "a351af62518b830044862c901fd06910046343b7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d3a8cae6e743a6a1a5719b860762a03aabce678a", + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a", "shasum": "" }, "require": { @@ -3526,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.26" + "source": "https://github.com/utopia-php/database/tree/0.53.27" }, - "time": "2024-12-02T07:36:52+00:00" + "time": "2024-12-02T08:53:55+00:00" }, { "name": "utopia-php/domains", From 3c418c16072f28dfa94066683a2b99a115de4680 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 18:08:10 +0900 Subject: [PATCH 046/161] Address params and events --- app/controllers/api/databases.php | 1 - app/controllers/shared/api.php | 4 ++-- composer.json | 2 +- composer.lock | 14 +++++++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 971faf82c6..06d5030fd3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2872,7 +2872,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForUsage') - ->inject('queueForRealtime') ->inject('project') ->inject('mode') ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, Realtime $queueForRealtime, Document $project, string $mode) { diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 3ef96298c6..5f5db46a70 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -95,9 +95,9 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que } if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * count($document->getAttribute('modified', [])); + $value = -1 * $document->getAttribute('modified', 0); } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = count($document->getAttribute('modified', [])); + $value = $document->getAttribute('modified', 0); } switch (true) { diff --git a/composer.json b/composer.json index ff0e44550d..0cd20fc577 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.26", + "utopia-php/database": "0.53.27", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 62dac10ab6..be7dd88f82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fad37c607bf3a162dff5d0ee76d56984", + "content-hash": "0b299e8aaf279f410c6d81c1ad3a5031", "packages": [ { "name": "adhocore/jwt", @@ -3476,16 +3476,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.26", + "version": "0.53.27", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "a351af62518b830044862c901fd06910046343b7" + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/a351af62518b830044862c901fd06910046343b7", - "reference": "a351af62518b830044862c901fd06910046343b7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d3a8cae6e743a6a1a5719b860762a03aabce678a", + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a", "shasum": "" }, "require": { @@ -3526,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.26" + "source": "https://github.com/utopia-php/database/tree/0.53.27" }, - "time": "2024-12-02T07:36:52+00:00" + "time": "2024-12-02T08:53:55+00:00" }, { "name": "utopia-php/domains", From 125585831bac53ef7c793edc59d45073bdfdf663 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 18:16:04 +0900 Subject: [PATCH 047/161] Remove bulk deletes realtime test --- .../Realtime/RealtimeCustomClientTest.php | 81 ------------------- 1 file changed, 81 deletions(-) diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index b3e7280b04..32ff3f7618 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -864,87 +864,6 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']['payload']); $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); - /** - * Test Document Bulk Delete - */ - $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Bradley Cooper' - ], - 'permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $client->receive(); - - $documentIds[] = $document['body']['$id']; - - $document2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Bradley Cooper' - ], - 'permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $client->receive(); - - $documentIds[] = $document2['body']['$id']; - - $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - while (!empty($documentIds)) { - $response = json_decode($client->receive(), true); - - $this->assertArrayHasKey('type', $response); - $this->assertArrayHasKey('data', $response); - $this->assertEquals('event', $response['type']); - $this->assertNotEmpty($response['data']); - $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); - $this->assertNotEmpty($response['data']['payload']); - - if (!in_array($response['data']['payload']['$id'], $documentIds)) { - $this->fail('Document ID not found in the payload'); - } - $documentId = $response['data']['payload']['$id']; - - $this->assertContains('documents', $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*.delete", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}", $response['data']['events']); - $this->assertContains("databases.*", $response['data']['events']); - - unset($documentIds[array_search($documentId, $documentIds)]); - } - $client->close(); } From f061f724e0172543f78768eb0651f3bff97a7673 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 19:06:34 +0900 Subject: [PATCH 048/161] Fix params --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 06d5030fd3..c5e598ff6f 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2874,7 +2874,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForUsage') ->inject('project') ->inject('mode') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, Realtime $queueForRealtime, Document $project, string $mode) { + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, Document $project, string $mode) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array $isBulk = true; From fbf985ea9042678b79f040dbd508743c807c304d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 19:57:21 +0900 Subject: [PATCH 049/161] Add event --- app/controllers/shared/api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 5f5db46a70..d7b4566d90 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -502,6 +502,7 @@ App::init() $dbForProject ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENTS_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $document, From fbbf846eb9af70185846aa6bbb47f9b4f43298fd Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 2 Dec 2024 19:59:48 +0900 Subject: [PATCH 050/161] Run Linter --- app/controllers/api/databases.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index c5e598ff6f..101a85a63a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,7 +4,6 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; -use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; From 257733aec09a08e78cb84cc8d729ef17dee9e3c1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 3 Dec 2024 17:35:46 +1300 Subject: [PATCH 051/161] Update app/controllers/api/databases.php --- app/controllers/api/databases.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 0fcc431de9..59b5899c4c 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3866,7 +3866,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection - // Trigger all events, we do this manually since we have to trigger multiple. $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database): bool { if ($document->isEmpty()) { return false; From 116ba6bc7b26590fdf77aaf1a0bd23f950f6e42e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 04:38:59 +0000 Subject: [PATCH 052/161] Fix Problems with tests and params --- app/controllers/api/databases.php | 2 - composer.json | 4 + composer.lock | 203 +++++++++--------- package-lock.json | 10 + .../Realtime/RealtimeCustomClientTest.php | 71 ------ 5 files changed, 116 insertions(+), 174 deletions(-) create mode 100644 package-lock.json diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 5dd7069341..f3064b1627 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3715,8 +3715,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->inject('queueForEvents') - ->inject('queueForRealtime') ->inject('project') ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Document $project) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array diff --git a/composer.json b/composer.json index b9cd44d1c4..ca18bed28a 100644 --- a/composer.json +++ b/composer.json @@ -96,6 +96,10 @@ "config": { "platform": { "php": "8.3" + }, + "allow-plugins": { + "php-http/discovery": false, + "tbachert/spi": false } } } diff --git a/composer.lock b/composer.lock index c68ab68db0..08c97122b6 100644 --- a/composer.lock +++ b/composer.lock @@ -157,16 +157,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.16.4", + "version": "0.16.5", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "7e4741337b9373f77210396e68eca539018cabd1" + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/7e4741337b9373f77210396e68eca539018cabd1", - "reference": "7e4741337b9373f77210396e68eca539018cabd1", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", "shasum": "" }, "require": { @@ -206,9 +206,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.16.4" + "source": "https://github.com/appwrite/runtimes/tree/0.16.5" }, - "time": "2024-10-26T10:39:59+00:00" + "time": "2024-11-25T15:17:06+00:00" }, { "name": "beberlei/assert", @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.28.3", + "version": "v4.29.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100" + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/c5c311e0f3d89928251ac5a2f0e3db283612c100", - "reference": "c5c311e0f3d89928251ac5a2f0e3db283612c100", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", + "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.28.3" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" }, - "time": "2024-10-22T22:27:17+00:00" + "time": "2024-11-27T18:37:40+00:00" }, { "name": "jean85/pretty-package-versions", @@ -2343,9 +2343,9 @@ "type": "library", "extra": { "branch-alias": { - "v10.0": "10.0.x-dev", + "v8.3": "8.3.x-dev", "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" + "v10.0": "10.0.x-dev" } }, "autoload": { @@ -2386,16 +2386,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -2433,7 +2433,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -2449,30 +2449,31 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/http-client", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a" + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", - "reference": "c30d91a1deac0dc3ed5e604683cf2e1dfc635b8a", + "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", + "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { + "amphp/amp": "<2.5", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2483,14 +2484,14 @@ "symfony/http-client-implementation": "3.0" }, "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", "symfony/dependency-injection": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", "symfony/messenger": "^6.4|^7.0", @@ -2527,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.8" + "source": "https://github.com/symfony/http-client/tree/v7.2.0" }, "funding": [ { @@ -2543,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:27+00:00" + "time": "2024-11-29T08:22:02+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "20414d96f391677bf80078aa55baece78b82647d" + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -2605,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" }, "funding": [ { @@ -2621,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2861,16 +2862,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -2924,7 +2925,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -2940,7 +2941,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "tbachert/spi", @@ -3928,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.12", + "version": "0.6.13", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260" + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/9a8c905af4cece5c5ec9542a5b534befce067260", - "reference": "9a8c905af4cece5c5ec9542a5b534befce067260", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", + "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", "shasum": "" }, "require": { @@ -3978,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.12" + "source": "https://github.com/utopia-php/migration/tree/0.6.13" }, - "time": "2024-11-12T00:31:53+00:00" + "time": "2024-11-26T13:57:53+00:00" }, { "name": "utopia-php/mongo", @@ -4362,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.6", + "version": "0.18.7", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071" + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/893ccf06e183f8ece2aed8dbf14d64d6ba036071", - "reference": "893ccf06e183f8ece2aed8dbf14d64d6ba036071", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", + "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", "shasum": "" }, "require": { @@ -4411,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.6" + "source": "https://github.com/utopia-php/storage/tree/0.18.7" }, - "time": "2024-11-06T09:58:50+00:00" + "time": "2024-11-28T11:10:53+00:00" }, { "name": "utopia-php/swoole", @@ -5127,16 +5128,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.2", + "version": "v1.18.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", "shasum": "" }, "require": { @@ -5147,13 +5148,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", + "friendsofphp/php-cs-fixer": "^3.65.0", + "illuminate/view": "^10.48.24", + "larastan/larastan": "^2.9.11", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -5189,7 +5190,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-20T09:33:46+00:00" + "time": "2024-11-26T15:34:00+00:00" }, { "name": "matthiasmullie/minify", @@ -7577,16 +7578,16 @@ }, { "name": "symfony/console", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", - "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", "shasum": "" }, "require": { @@ -7650,7 +7651,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.8" + "source": "https://github.com/symfony/console/tree/v7.2.0" }, "funding": [ { @@ -7666,20 +7667,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -7716,7 +7717,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.6" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -7732,20 +7733,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { @@ -7780,7 +7781,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.6" + "source": "https://github.com/symfony/finder/tree/v7.2.0" }, "funding": [ { @@ -7796,20 +7797,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:31:23+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", - "reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -7847,7 +7848,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.6" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -7863,7 +7864,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8181,16 +8182,16 @@ }, { "name": "symfony/process", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", - "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -8222,7 +8223,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.8" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -8238,20 +8239,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:23:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.8", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", - "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -8309,7 +8310,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.8" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -8325,7 +8326,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:21+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "textalk/websocket", @@ -8557,7 +8558,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..6ab33b14fe --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10 @@ +{ + "name": "@appwrite.io/repo", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@appwrite.io/repo" + } + } +} diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 316999b9b9..32ff3f7618 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -864,77 +864,6 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']['payload']); $this->assertEquals($response['data']['payload']['name'], 'Bradley Cooper'); - /** - * Test Documents Update - */ - $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Bradley Cooper' - ], - 'permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $client->receive(); - $documentIds[] = $document['body']['$id']; - - $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'name' => 'Bradley Cooper 2' - ], - 'permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $updateDocumentIds = $documentIds; - while (!empty($updateDocumentIds)) { - $response = json_decode($client->receive(), true); - - $this->assertArrayHasKey('type', $response); - $this->assertArrayHasKey('data', $response); - $this->assertEquals('event', $response['type']); - $this->assertNotEmpty($response['data']); - $this->assertArrayHasKey('timestamp', $response['data']); - $this->assertCount(3, $response['data']['channels']); - $this->assertNotEmpty($response['data']['payload']); - - if (!in_array($response['data']['payload']['$id'], $updateDocumentIds)) { - $this->fail('Document ID not found in the payload'); - } - $documentId = $response['data']['payload']['$id']; - - $this->assertContains('documents', $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents", $response['data']['channels']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}.update", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*.update", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.{$actorsId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}.update", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.{$documentId}", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*.update", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*.documents.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}.collections.*", $response['data']['events']); - $this->assertContains("databases.{$databaseId}", $response['data']['events']); - $this->assertContains("databases.*", $response['data']['events']); - - unset($updateDocumentIds[array_search($documentId, $updateDocumentIds)]); - } - $client->close(); } From 41ead533b8c04c94b188546181d8326422da74d1 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 05:03:51 +0000 Subject: [PATCH 053/161] Linter --- app/controllers/api/databases.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 875b01f656..ac8cff8d84 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,7 +4,6 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; use Appwrite\Event\Event; -use Appwrite\Event\Realtime; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; From 3d4917727b5f9c3aa2ccdb55fe5c19668e53b7ba Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 15:14:07 +0900 Subject: [PATCH 054/161] Address Comments --- app/controllers/api/databases.php | 36 +++++++++++++++++++ .../e2e/Services/Databases/DatabasesBase.php | 2 ++ 2 files changed, 38 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index ac8cff8d84..991b774fbb 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3781,6 +3781,42 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $queries ) ); + + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + + $relationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + foreach ($relationships as $relationship) { + $related = $document->getAttribute($relationship->getAttribute('key')); + + if (empty($related)) { + continue; + } + if (!\is_array($related)) { + $related = [$related]; + } + + $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + $relatedCollection = Authorization::skip( + fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + ); + + foreach ($related as $relation) { + if ($relation instanceof Document) { + $processDocument($relatedCollection, $relation); + } + } + } + }; + + foreach ($documents as $document) { + $processDocument($collection, $document); + } $response->dynamic(new Document([ 'total' => \count($documents), diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index fa98fd1a15..c262abfab1 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5554,6 +5554,8 @@ trait DatabasesBase Permission::update(Role::user($this->getUser()['$id'])), Permission::delete(Role::user($this->getUser()['$id'])), ], $document['$permissions']); + $this->assertEquals($collection['body']['$id'], $document['$collectionId']); + $this->assertEquals($data['databaseId'], $document['$databaseId']); } // TEST: Check permissions persist From 7f2d3beb31744a10fb79e19cd89fb462ef2430d9 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 15:19:58 +0900 Subject: [PATCH 055/161] Run Linter --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 991b774fbb..099dfef8a8 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3781,7 +3781,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $queries ) ); - + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); From e2ab6a05ab85fb94b35f028874b72bad716a3df2 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 16:40:03 +0900 Subject: [PATCH 056/161] Fix permissions and accompanying tests --- app/controllers/api/databases.php | 66 +++++++++++-------- .../Databases/DatabasesCustomClientTest.php | 50 ++++++++++---- 2 files changed, 74 insertions(+), 42 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 101a85a63a..114fd28404 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2919,38 +2919,46 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') Database::PERMISSION_DELETE, ]; - // Map aggregate permissions to into the set of individual permissions they represent. - $permissions = Permission::aggregate($permissions, $allowedPermissions); - - // Add permissions for current the user if none were provided. - if (\is_null($permissions)) { - $permissions = []; - if (!empty($user->getId())) { - foreach ($allowedPermissions as $permission) { - $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); - } + $setPermissions = function (Document $document, ?array $permissions) use ($user, $allowedPermissions, $isAPIKey, $isPrivilegedUser, $isBulk) { + // Map aggregate permissions to into the set of individual permissions they represent. + if ($isBulk) { + $permissions = $document['$permissions'] ?? null; } - } - // Users can only manage their own roles, API keys and Admin users can manage any - if (!$isAPIKey && !$isPrivilegedUser) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', Authorization::getRoles()) . ')'); + $permissions = Permission::aggregate($permissions, $allowedPermissions); + + // Add permissions for current the user if none were provided. + if (\is_null($permissions)) { + $permissions = []; + if (!empty($user->getId())) { + foreach ($allowedPermissions as $permission) { + $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); } } } - } + + // Users can only manage their own roles, API keys and Admin users can manage any + if (!$isAPIKey && !$isPrivilegedUser) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', Authorization::getRoles()) . ')'); + } + } + } + } + + $document->setAttribute('$permissions', $permissions); + }; $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database) { $documentSecurity = $collection->getAttribute('documentSecurity', false); @@ -3032,9 +3040,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } }; - $documents = array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId) { + $documents = array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId, $setPermissions) { $document['$collection'] = $collection->getId(); - $document['$permissions'] = $permissions; if (!$isBulk) { $document['$id'] = $documentId == 'unique()' ? ID::unique() : $documentId; @@ -3048,6 +3055,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $document = new Document($document); + $setPermissions($document, $permissions); $checkPermissions($collection, $document, Database::PERMISSION_CREATE); return $document; diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 56922b602b..399a63eb2b 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -914,7 +914,7 @@ class DatabasesCustomClientTest extends Scope ]), [ 'collectionId' => ID::unique(), 'name' => 'Bulk Create', - 'documentSecurity' => true, + 'documentSecurity' => false, 'permissions' => [ Permission::read(Role::any()), Permission::delete(Role::any()), @@ -1029,22 +1029,34 @@ class DatabasesCustomClientTest extends Scope [ '$id' => ID::unique(), 'number' => 1, + '$permissions' => [ + Permission::create(Role::user('aaaaaa')), + Permission::read(Role::user('aaaaaa')), + Permission::update(Role::user('aaaaaa')), + Permission::delete(Role::user('aaaaaa')), + ] ], [ '$id' => ID::unique(), 'number' => 2, + '$permissions' => [ + Permission::create(Role::user('aaaaaa')), + Permission::read(Role::user('aaaaaa')), + Permission::update(Role::user('aaaaaa')), + Permission::delete(Role::user('aaaaaa')), + ] ], [ '$id' => ID::unique(), 'number' => 3, + '$permissions' => [ + Permission::create(Role::user('aaaaaa')), + Permission::read(Role::user('aaaaaa')), + Permission::update(Role::user('aaaaaa')), + Permission::delete(Role::user('aaaaaa')), + ] ], ], - 'permissions' => [ - Permission::write(Role::user('aaaaaa')), - Permission::read(Role::user('aaaaaa')), - Permission::update(Role::user('aaaaaa')), - Permission::delete(Role::user('aaaaaa')), - ] ]); $this->assertEquals(401, $response['headers']['status-code']); @@ -1058,22 +1070,34 @@ class DatabasesCustomClientTest extends Scope [ '$id' => ID::unique(), 'number' => 1, + '$permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] ], [ '$id' => ID::unique(), 'number' => 2, + '$permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] ], [ '$id' => ID::unique(), 'number' => 3, + '$permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] ], ], - 'permissions' => [ - Permission::write(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] ]); $this->assertEquals(201, $response['headers']['status-code']); From bcb4ffa40460670438511f3cb5b502f64c8e66b5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 3 Dec 2024 17:39:25 +0900 Subject: [PATCH 057/161] Fix Tests --- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 09b77a74ab..80f0c0b30f 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5781,7 +5781,7 @@ trait DatabasesBase $createBulkDocuments = function ($amount = 10) use ($data) { $documents = []; - for ($x = 0; $x <= $amount; $x++) { + for ($x = 1; $x <= $amount; $x++) { $documents[] = [ '$id' => ID::unique(), 'number' => $x, From f707be6ed321a7db535aa3c8d3a9a6e0ff50c49d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 4 Dec 2024 09:13:08 +0900 Subject: [PATCH 058/161] Add extra tests --- .../e2e/Services/Databases/DatabasesBase.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 80f0c0b30f..39f34d09f5 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4933,6 +4933,38 @@ trait DatabasesBase $this->assertEquals(400, $response['headers']['status-code']); $this->assertEquals('$id is required inside documents when creating bulk documents', $response['body']['message']); + + // TEST FAIL - Can't miss number in bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + ], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't push more than 10000 documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => array_fill(0, 10001, [ + '$id' => ID::unique(), + 'number' => 1, + ]), + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `documents` param: Value must a valid array no longer than 10000 items and Value must be a valid JSON string', $response['body']['message']); } public function testBulkCreateRelationships(): void From 879ddb30745a64fd5c6702666ef6efbdf5159615 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 9 Dec 2024 14:21:56 +0900 Subject: [PATCH 059/161] Implement SDK Method Multiplexing --- app/config/specs/open-api3-latest-client.json | 16 ++++++++++++++++ app/config/specs/open-api3-latest-console.json | 16 ++++++++++++++++ app/config/specs/open-api3-latest-server.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-client.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-console.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-server.json | 16 ++++++++++++++++ app/controllers/api/databases.php | 11 ++++++++++- src/Appwrite/Specification/Format/OpenAPI3.php | 10 +++++++++- src/Appwrite/Specification/Format/Swagger2.php | 9 +++++++++ 9 files changed, 124 insertions(+), 2 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 55be1565b7..0320b7b140 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4571,6 +4571,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a98e06dc69..88e57cf635 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8140,6 +8140,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 2c1e276c07..345d4e49f9 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,6 +7667,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [], "Session": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 8dce505cac..627039714a 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4739,6 +4739,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index a09e8999fb..20f6bad540 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8295,6 +8295,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index d0d6eb530d..8eb9af6284 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7809,6 +7809,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [], "Session": [] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 593e3b39d9..4fcdefde01 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2854,7 +2854,16 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createDocument') + ->label('sdk.method', [ + 'createDocument' => [ + 'parameters' => ['documentId', 'data', 'permissions'], + 'response' => Response::MODEL_DOCUMENT, + ], + 'createDocuments' => [ + 'parameters' => ['documents'], + 'response' => Response::MODEL_DOCUMENT_LIST, + ], + ]) ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index f7430ec70e..4dc6e222e0 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -122,8 +122,12 @@ class OpenAPI3 extends Format $scope = $route->getLabel('scope', ''); $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; $produces = $route->getLabel('sdk.response.type', null); $model = $route->getLabel('sdk.response.model', 'none'); @@ -178,6 +182,10 @@ class OpenAPI3 extends Format ], ]; + if (is_array($route->getLabel('sdk.method', ''))) { + $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + } + foreach ($this->models as $value) { if (\is_array($model)) { $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index f2e324c71f..d9d2307e07 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -121,6 +121,11 @@ class Swagger2 extends Format $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; $method = $route->getLabel('sdk.method', \uniqid()); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; $produces = $route->getLabel('sdk.response.type', null); $model = $route->getLabel('sdk.response.model', 'none'); @@ -181,6 +186,10 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } + if (is_array($route->getLabel('sdk.method', ''))) { + $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + } + foreach ($this->models as $value) { if (\is_array($model)) { $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); From e9c2ebbcf5af7ec15128029adda1d9ef22e74589 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 10 Dec 2024 12:31:26 +0900 Subject: [PATCH 060/161] Implement SDK Multiplexing for Create Document/s --- app/config/specs/open-api3-latest-client.json | 26 ++++++++++++++++--- .../specs/open-api3-latest-console.json | 26 ++++++++++++++++--- app/config/specs/open-api3-latest-server.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-client.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-console.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-server.json | 26 ++++++++++++++++--- app/controllers/api/databases.php | 18 ++++++++++--- docs/references/databases/create-documents.md | 1 + .../Specification/Format/Swagger2.php | 7 +++++ 9 files changed, 155 insertions(+), 27 deletions(-) create mode 100644 docs/references/databases/create-documents.md diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 0320b7b140..b95a279a05 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4540,11 +4540,18 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -4573,18 +4580,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 88e57cf635..31d3850c49 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8109,11 +8109,18 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -8142,18 +8149,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 345d4e49f9..11f1f40aac 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7636,11 +7636,18 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -7669,18 +7676,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 627039714a..eed10f9f38 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4712,9 +4712,16 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -4741,18 +4748,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } }, "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 20f6bad540..8fd21bc7ef 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8268,9 +8268,16 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -8297,18 +8304,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } }, "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 8eb9af6284..b82a08e255 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7782,9 +7782,16 @@ "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -7811,18 +7818,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } }, "auth": { diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4fcdefde01..4de4c4420e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2856,18 +2856,30 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.namespace', 'databases') ->label('sdk.method', [ 'createDocument' => [ - 'parameters' => ['documentId', 'data', 'permissions'], + 'name' => 'Create Document', + 'parameters' => [ + 'documentId', + 'data', + 'permissions', + ], + 'required' => ['documentId', 'data'], 'response' => Response::MODEL_DOCUMENT, + 'description' => '/docs/references/databases/create-document.md', ], 'createDocuments' => [ - 'parameters' => ['documents'], + 'name' => 'Create Documents', + 'parameters' => [ + 'documents' + ], + 'required' => ['documents'], 'response' => Response::MODEL_DOCUMENT_LIST, + 'description' => '/docs/references/databases/create-documents.md' ], ]) ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) + ->label('sdk.response.model', [Response::MODEL_DOCUMENT, Response::MODEL_DOCUMENT_LIST]) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md new file mode 100644 index 0000000000..6428108d28 --- /dev/null +++ b/docs/references/databases/create-documents.md @@ -0,0 +1 @@ +Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d9d2307e07..a6cb9d1e5c 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -188,6 +188,13 @@ class Swagger2 extends Format if (is_array($route->getLabel('sdk.method', ''))) { $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + + foreach ($temp['x-appwrite']['multiplex'] as $key => $value) { + if (!empty($value['description'])) { + $desc = \realpath(__DIR__ . '/../../../../' . $value['description']); + $temp['x-appwrite']['multiplex'][$key]['description'] = $desc ? \file_get_contents($desc) : ''; + } + } } foreach ($this->models as $value) { From f7e69624c60a6c32fbad54722676e22c98b88d08 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 11 Dec 2024 10:19:10 +0900 Subject: [PATCH 061/161] Address comments --- app/config/specs/open-api3-latest-client.json | 2 +- app/config/specs/open-api3-latest-console.json | 2 +- app/config/specs/open-api3-latest-server.json | 2 +- app/config/specs/swagger2-latest-client.json | 6 +++--- app/config/specs/swagger2-latest-console.json | 6 +++--- app/config/specs/swagger2-latest-server.json | 6 +++--- docs/references/databases/create-document.md | 2 +- docs/references/databases/create-documents.md | 1 - src/Appwrite/Specification/Format/Swagger2.php | 7 ------- 9 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 docs/references/databases/create-documents.md diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index b95a279a05..7f79d5e87b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4537,7 +4537,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 31d3850c49..8b2a800291 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8106,7 +8106,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 11f1f40aac..388b9bb30d 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7633,7 +7633,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index eed10f9f38..e736f20227 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4709,7 +4709,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", @@ -4759,7 +4759,7 @@ "data" ], "response": "document", - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -4770,7 +4770,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 8fd21bc7ef..dcec505131 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8265,7 +8265,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", @@ -8315,7 +8315,7 @@ "data" ], "response": "document", - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -8326,7 +8326,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index b82a08e255..fc252c40ea 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7779,7 +7779,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document, or Documents List", @@ -7829,7 +7829,7 @@ "data" ], "response": "document", - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -7840,7 +7840,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/docs/references/databases/create-document.md b/docs/references/databases/create-document.md index a2444d58a4..a02d7c8bf1 100644 --- a/docs/references/databases/create-document.md +++ b/docs/references/databases/create-document.md @@ -1 +1 @@ -Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file +Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md deleted file mode 100644 index 6428108d28..0000000000 --- a/docs/references/databases/create-documents.md +++ /dev/null @@ -1 +0,0 @@ -Create a batch of new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index a6cb9d1e5c..d9d2307e07 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -188,13 +188,6 @@ class Swagger2 extends Format if (is_array($route->getLabel('sdk.method', ''))) { $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); - - foreach ($temp['x-appwrite']['multiplex'] as $key => $value) { - if (!empty($value['description'])) { - $desc = \realpath(__DIR__ . '/../../../../' . $value['description']); - $temp['x-appwrite']['multiplex'][$key]['description'] = $desc ? \file_get_contents($desc) : ''; - } - } } foreach ($this->models as $value) { From b4c77fbd5fc037d2270d3dda3ddafa79b4bc4d54 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 16 Dec 2024 14:59:01 +0900 Subject: [PATCH 062/161] Get Initial Draft Working --- app/config/specs/open-api3-latest-client.json | 237 ++--- .../specs/open-api3-latest-console.json | 287 +++--- app/config/specs/open-api3-latest-server.json | 246 ++---- app/config/specs/swagger2-latest-client.json | 267 +++--- app/config/specs/swagger2-latest-console.json | 437 ++++----- app/config/specs/swagger2-latest-server.json | 361 ++++---- app/controllers/api/account.php | 832 ++++++++++-------- app/controllers/api/avatars.php | 123 +-- app/controllers/api/console.php | 34 +- app/controllers/api/databases.php | 806 +++++++++-------- app/controllers/api/functions.php | 454 ++++++---- app/controllers/api/graphql.php | 69 +- app/controllers/api/health.php | 383 ++++---- app/controllers/api/locale.php | 163 ++-- app/controllers/api/messaging.php | 739 +++++++++------- app/controllers/api/migrations.php | 277 +++--- app/controllers/api/project.php | 96 +- app/controllers/api/projects.php | 688 +++++++++------ app/controllers/api/proxy.php | 80 +- app/controllers/api/storage.php | 245 +++--- app/controllers/api/teams.php | 244 ++--- app/controllers/api/users.php | 679 ++++++++------ app/controllers/api/vcs.php | 178 ++-- app/controllers/mock.php | 4 +- app/controllers/shared/api.php | 13 +- docs/references/account/create-push-target.md | 1 + docs/references/account/delete-push-target.md | 1 + docs/references/account/update-push-target.md | 1 + docs/references/health/get-version.md | 1 + src/Appwrite/GraphQL/Schema.php | 11 +- src/Appwrite/GraphQL/Types/Mapper.php | 9 +- src/Appwrite/Platform/Tasks/Specs.php | 27 +- src/Appwrite/SDK/Method.php | 222 +++++ .../Specification/Format/OpenAPI3.php | 85 +- .../Specification/Format/Swagger2.php | 85 +- 35 files changed, 4635 insertions(+), 3750 deletions(-) create mode 100644 docs/references/account/create-push-target.md create mode 100644 docs/references/account/delete-push-target.md create mode 100644 docs/references/account/update-push-target.md create mode 100644 docs/references/health/get-version.md create mode 100644 src/Appwrite/SDK/Method.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 7f79d5e87b..7de634f988 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -857,10 +857,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -2479,7 +2479,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2499,7 +2499,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2560,7 +2560,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2580,7 +2580,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2640,17 +2640,10 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2660,7 +2653,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4531,151 +4524,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -5549,6 +5397,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -9843,6 +9742,20 @@ "countryName" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 8b2a800291..b27f65f130 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -889,10 +889,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -2493,7 +2493,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2513,7 +2513,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2573,7 +2573,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2593,7 +2593,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2652,17 +2652,10 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2672,7 +2665,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4745,7 +4738,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5636,7 +5629,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5857,7 +5850,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -6078,7 +6071,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -6308,7 +6301,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6548,7 +6541,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6791,7 +6784,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -7024,7 +7017,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -7389,7 +7382,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7615,7 +7608,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7914,7 +7907,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -8100,151 +8093,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -9297,7 +9145,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9466,7 +9314,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10141,7 +9989,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10949,7 +10797,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11036,7 +10884,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11522,7 +11370,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13458,6 +13306,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -14696,7 +14595,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14716,7 +14615,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18674,7 +18573,7 @@ "type": "", "deprecated": false, "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18802,7 +18701,7 @@ "type": "", "deprecated": false, "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19656,7 +19555,7 @@ "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23306,11 +23205,11 @@ "description": "", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/project" + "$ref": "#\/components\/schemas\/emailTemplate" } } } @@ -26666,7 +26565,7 @@ "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -37187,6 +37086,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 388b9bb30d..a772d5984f 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -866,10 +866,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -5140,7 +5140,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5363,7 +5363,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5586,7 +5586,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -5818,7 +5818,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6060,7 +6060,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6305,7 +6305,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6540,7 +6540,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -6908,7 +6908,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7136,7 +7136,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7438,7 +7438,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7627,153 +7627,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [], - "Session": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -9833,7 +9686,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9921,7 +9774,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12300,6 +12153,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -13560,7 +13464,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13580,7 +13484,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26809,6 +26713,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index e736f20227..9c8da35b7c 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -367,7 +367,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -778,7 +780,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -922,14 +926,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1806,7 +1815,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2490,7 +2501,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2611,7 +2624,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2627,7 +2640,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2697,7 +2710,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2713,7 +2726,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2776,7 +2789,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { "description": "No content" @@ -2789,7 +2802,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4697,151 +4710,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -5241,7 +5109,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5743,6 +5613,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -6709,7 +6632,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -7444,7 +7369,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -7872,7 +7799,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -10021,6 +9950,20 @@ "countryName" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index dcec505131..aba7d5c4b2 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -225,7 +225,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -421,7 +423,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -827,7 +831,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -970,14 +976,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1841,7 +1852,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2522,7 +2535,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2641,7 +2656,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2657,7 +2672,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2726,7 +2741,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2742,7 +2757,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2804,7 +2819,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { "description": "No content" @@ -2817,7 +2832,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4948,7 +4963,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5146,7 +5161,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5572,7 +5589,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5829,7 +5848,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6045,7 +6066,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6261,7 +6284,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6487,7 +6512,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6725,7 +6752,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6967,7 +6996,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7197,7 +7228,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7561,7 +7594,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7783,7 +7818,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7998,7 +8035,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8071,7 +8110,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8253,151 +8294,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -8797,7 +8693,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9243,7 +9141,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9420,7 +9320,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9584,7 +9484,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10280,7 +10180,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10641,7 +10541,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11013,7 +10915,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11079,7 +10983,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11096,7 +11002,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11180,7 +11086,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11580,7 +11486,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11668,7 +11576,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12039,7 +11947,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -13654,6 +13564,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -14976,7 +14939,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14992,7 +14955,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19112,7 +19075,7 @@ "type": "", "deprecated": false, "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19246,7 +19209,7 @@ "type": "", "deprecated": false, "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20018,7 +19981,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "migrations" ], @@ -20097,7 +20062,7 @@ "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20434,7 +20399,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "project" ], @@ -20908,7 +20875,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -22390,7 +22359,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -22952,7 +22923,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -23333,7 +23306,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -23779,9 +23754,9 @@ "description": "", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "schema": { - "$ref": "#\/definitions\/project" + "$ref": "#\/definitions\/emailTemplate" } } }, @@ -25314,7 +25289,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -25673,7 +25650,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "proxy" ], @@ -26208,7 +26187,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -26613,7 +26594,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -27127,7 +27110,7 @@ "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -27504,7 +27487,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -28006,7 +27991,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -28749,7 +28736,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -29484,7 +29473,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -30841,7 +30832,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -30899,7 +30892,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -32177,7 +32172,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], @@ -32395,7 +32392,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], @@ -37702,6 +37701,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index fc252c40ea..26d911ca12 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -385,7 +385,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -801,7 +803,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -946,14 +950,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1843,7 +1852,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2395,7 +2406,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -4629,7 +4642,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5060,7 +5075,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5320,7 +5337,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5538,7 +5557,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5756,7 +5777,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5984,7 +6007,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6224,7 +6249,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6468,7 +6495,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6700,7 +6729,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7067,7 +7098,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7291,7 +7324,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7508,7 +7543,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7582,7 +7619,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7767,153 +7806,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [], - "Session": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -8321,7 +8213,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8682,7 +8576,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9525,7 +9421,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9902,7 +9800,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9969,7 +9869,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9986,7 +9888,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10071,7 +9973,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10479,7 +10381,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -10861,7 +10765,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -12504,6 +12410,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -13848,7 +13807,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13864,7 +13823,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18081,7 +18040,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -18495,7 +18456,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -19246,7 +19209,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -19684,7 +19649,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -20440,7 +20407,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -21108,7 +21077,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -22484,7 +22455,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -22543,7 +22516,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -27295,6 +27270,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 76a3ef8b61..1b8c3ac30e 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -21,6 +21,10 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; @@ -279,13 +283,15 @@ App::post('/v1/account') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/account/create.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'create', + description: '/docs/references/account/create.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -416,15 +422,17 @@ App::get('/v1/account') ->desc('Get account') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/account/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'get', + description: '/docs/references/account/get.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + offlineModel: '/account', + offlineKey: 'current' + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -441,12 +449,15 @@ App::delete('/v1/account') ->label('scope', 'account') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/account/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'delete', + description: '/docs/references/account/delete.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('project') ->inject('response') @@ -486,14 +497,16 @@ App::get('/v1/account/sessions') ->desc('List sessions') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/account/list-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) - ->label('sdk.offline.model', '/account/sessions') + ->label('sdk', new Method( + namespace: 'account', + name: 'listSessions', + description: '/docs/references/account/list-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION_LIST, + responseType: ResponseType::JSON, + offlineModel: '/account/sessions' + )) ->inject('response') ->inject('user') ->inject('locale') @@ -530,12 +543,15 @@ App::delete('/v1/account/sessions') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/account/delete-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSessions', + description: '/docs/references/account/delete-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 100) ->inject('request') ->inject('response') @@ -592,15 +608,17 @@ App::get('/v1/account/sessions/:sessionId') ->desc('Get session') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getSession') - ->label('sdk.description', '/docs/references/account/get-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) - ->label('sdk.offline.model', '/account/sessions') - ->label('sdk.offline.key', '{sessionId}') + ->label('sdk', new Method( + namespace: 'account', + name: 'getSession', + description: '/docs/references/account/get-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON, + offlineModel: '/account/sessions', + offlineKey: '{sessionId}' + )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') ->inject('user') @@ -641,12 +659,15 @@ App::delete('/v1/account/sessions/:sessionId') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/account/delete-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSession', + description: '/docs/references/account/delete-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') ->inject('requestTimestamp') @@ -722,13 +743,15 @@ App::patch('/v1/account/sessions/:sessionId') ->label('audits.event', 'session.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateSession') - ->label('sdk.description', '/docs/references/account/update-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateSession', + description: '/docs/references/account/update-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to update the current device session.') ->inject('response') @@ -800,13 +823,15 @@ App::post('/v1/account/sessions/email') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailPasswordSession') - ->label('sdk.description', '/docs/references/account/create-session-email-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailPasswordSession', + description: '/docs/references/account/create-session-email-password.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', new Email(), 'User email.') @@ -934,13 +959,15 @@ App::post('/v1/account/sessions/anonymous') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createAnonymousSession') - ->label('sdk.description', '/docs/references/account/create-session-anonymous.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createAnonymousSession', + description: '/docs/references/account/create-session-anonymous.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->inject('request') @@ -1071,13 +1098,15 @@ App::post('/v1/account/sessions/token') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -1098,14 +1127,17 @@ App::get('/v1/account/sessions/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.hide', [APP_PLATFORM_SERVER]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Session') - ->label('sdk.description', '/docs/references/account/create-session-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Session', + description: '/docs/references/account/create-session-oauth2.md', + methodType: MethodType::WEBAUTH, + auth: [], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + responseModel: Response::MODEL_NONE, + hide: [APP_PLATFORM_SERVER], + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1688,13 +1720,16 @@ App::get('/v1/account/tokens/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Token') - ->label('sdk.description', '/docs/references/account/create-token-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Token', + description: '/docs/references/account/create-token-oauth2.md', + auth: [], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + responseModel: Response::MODEL_NONE, + methodType: MethodType::WEBAUTH, + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1761,13 +1796,15 @@ App::post('/v1/account/tokens/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMagicURLToken') - ->label('sdk.description', '/docs/references/account/create-token-magic-url.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMagicURLToken', + description: '/docs/references/account/create-token-magic-url.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2004,13 +2041,15 @@ App::post('/v1/account/tokens/email') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailToken') - ->label('sdk.description', '/docs/references/account/create-token-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailToken', + description: '/docs/references/account/create-token-email.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2233,14 +2272,16 @@ App::put('/v1/account/sessions/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMagicURLSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMagicURLSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2264,14 +2305,16 @@ App::put('/v1/account/sessions/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2296,13 +2339,15 @@ App::post('/v1/account/tokens/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneToken') - ->label('sdk.description', '/docs/references/account/create-token-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneToken', + description: '/docs/references/account/create-token-phone.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2474,13 +2519,15 @@ App::post('/v1/account/jwts') ->groups(['api', 'account', 'auth']) ->label('scope', 'account') ->label('auth.type', 'jwt') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/account/create-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'account', + name: 'createJWT', + description: '/docs/references/account/create-jwt.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_JWT, + )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') ->inject('response') @@ -2516,15 +2563,17 @@ App::get('/v1/account/prefs') ->desc('Get account preferences') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/account/get-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getPrefs', + description: '/docs/references/account/get-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PREFERENCES, + offlineModel: '/account/prefs', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -2538,13 +2587,15 @@ App::get('/v1/account/logs') ->desc('List logs') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/account/list-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'account', + name: 'listLogs', + description: '/docs/references/account/list-logs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST, + )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') ->inject('user') @@ -2606,15 +2657,17 @@ App::patch('/v1/account/name') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/account/update-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateName', + description: '/docs/references/account/update-name.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') ->inject('response') @@ -2640,15 +2693,17 @@ App::patch('/v1/account/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/account/update-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePassword', + description: '/docs/references/account/update-password.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->param('oldPassword', '', new Password(), 'Current user password. Must be at least 8 chars.', true) @@ -2709,15 +2764,17 @@ App::patch('/v1/account/email') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/account/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateEmail', + description: '/docs/references/account/update-email.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2801,15 +2858,17 @@ App::patch('/v1/account/phone') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/account/update-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhone', + description: '/docs/references/account/update-phone.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2882,15 +2941,17 @@ App::patch('/v1/account/prefs') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/account/update-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePrefs', + description: '/docs/references/account/update-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account/prefs', + offlineKey: 'current', + )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') ->inject('response') @@ -2915,13 +2976,15 @@ App::patch('/v1/account/status') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/account/update-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateStatus', + description: '/docs/references/account/update-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER + )) ->inject('requestTimestamp') ->inject('request') ->inject('response') @@ -2959,13 +3022,15 @@ App::post('/v1/account/recovery') ->label('audits.event', 'recovery.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createRecovery') - ->label('sdk.description', '/docs/references/account/create-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createRecovery', + description: '/docs/references/account/create-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') @@ -3139,13 +3204,15 @@ App::put('/v1/account/recovery') ->label('audits.event', 'recovery.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateRecovery') - ->label('sdk.description', '/docs/references/account/update-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateRecovery', + description: '/docs/references/account/update-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3223,13 +3290,15 @@ App::post('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createVerification') - ->label('sdk.description', '/docs/references/account/create-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createVerification', + description: '/docs/references/account/create-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('url', '', fn ($clients) => new Host($clients), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page @@ -3388,13 +3457,15 @@ App::put('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateVerification') - ->label('sdk.description', '/docs/references/account/update-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateVerification', + description: '/docs/references/account/update-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3448,13 +3519,15 @@ App::post('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneVerification') - ->label('sdk.description', '/docs/references/account/create-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneVerification', + description: '/docs/references/account/create-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) ->inject('request') @@ -3575,13 +3648,15 @@ App::put('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/account/update-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneVerification', + description: '/docs/references/account/update-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3634,15 +3709,17 @@ App::patch('/v1/account/mfa') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMFA') - ->label('sdk.description', '/docs/references/account/update-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMFA', + description: '/docs/references/account/update-mfa.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') ->inject('response') @@ -3683,15 +3760,17 @@ App::get('/v1/account/mfa/factors') ->desc('List factors') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/account/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'listMfaFactors', + description: '/docs/references/account/list-mfa-factors.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_FACTORS, + offlineKey: 'current', + offlineModel: '/account' + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3719,15 +3798,17 @@ App::post('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/create-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_TYPE) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaAuthenticator', + description: '/docs/references/account/create-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_TYPE, + offlineModel: '/account', + offlineKey: 'current' + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') @@ -3791,15 +3872,17 @@ App::put('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/update-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaAuthenticator', + description: '/docs/references/account/update-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current' + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') ->inject('response') @@ -3856,15 +3939,17 @@ App::post('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaRecoveryCodes', + description: '/docs/references/account/create-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->inject('dbForProject') @@ -3898,15 +3983,17 @@ App::patch('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/account/update-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('dbForProject') ->inject('response') ->inject('user') @@ -3935,15 +4022,17 @@ App::get('/v1/account/mfa/recovery-codes') ->desc('Get MFA recovery codes') ->groups(['api', 'account', 'mfaProtected']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getMfaRecoveryCodes', + description: '/docs/references/account/get-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3969,12 +4058,14 @@ App::delete('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteMfaAuthenticator', + description: '/docs/references/account/delete-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') ->inject('user') @@ -4007,13 +4098,15 @@ App::post('/v1/account/mfa/challenge') ->label('audits.event', 'challenge.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaChallenge') - ->label('sdk.description', '/docs/references/account/create-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_CHALLENGE) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaChallenge', + description: '/docs/references/account/create-mfa-challenge.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_CHALLENGE, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP, Type::RECOVERY_CODE]), 'Factor used for verification. Must be one of following: `' . Type::EMAIL . '`, `' . Type::PHONE . '`, `' . Type::TOTP . '`, `' . Type::RECOVERY_CODE . '`.') @@ -4195,12 +4288,15 @@ App::put('/v1/account/mfa/challenge') ->label('audits.event', 'challenges.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaChallenge') - ->label('sdk.description', '/docs/references/account/update-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaChallenge', + description: '/docs/references/account/update-mfa-challenge.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') ->param('challengeId', '', new Text(256), 'ID of the challenge.') @@ -4281,12 +4377,15 @@ App::post('/v1/account/targets/push') ->label('audits.event', 'target.create') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPushTarget', + description: '/docs/references/account/create-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET, + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->param('providerId', '', new UID(), 'Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.', true) @@ -4354,12 +4453,15 @@ App::put('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.update') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].update') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePushTarget', + description: '/docs/references/account/update-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET, + )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->inject('queueForEvents') @@ -4411,12 +4513,14 @@ App::delete('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.delete') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].delete') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deletePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'deletePushTarget', + description: '/docs/references/account/delete-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') ->inject('queueForDeletes') @@ -4454,14 +4558,16 @@ App::get('/v1/account/identities') ->desc('List identities') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/account/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) - ->label('sdk.offline.model', '/account/identities') + ->label('sdk', new Method( + namespace: 'account', + name: 'listIdentities', + description: '/docs/references/account/list-identities.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_IDENTITY_LIST, + offlineModel: '/account/identities', + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('user') @@ -4520,12 +4626,14 @@ App::delete('/v1/account/identities/:identityId') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') ->label('audits.userId', '{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/account/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteIdentity', + description: '/docs/references/account/delete-identity.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index dadd9da5e3..001ae09b94 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -1,6 +1,10 @@ label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/credit-card') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getCreditCard') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-credit-card.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getCreditCard', + description: '/docs/references/avatars/get-credit-card.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -184,13 +191,16 @@ App::get('/v1/avatars/browsers/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/browser') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getBrowser') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-browser.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getBrowser', + description: '/docs/references/avatars/get-browser.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -204,13 +214,16 @@ App::get('/v1/avatars/flags/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/flag') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFlag') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-flag.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFlag', + description: '/docs/references/avatars/get-flag.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -224,13 +237,16 @@ App::get('/v1/avatars/image') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/image') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getImage') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-image.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getImage', + description: '/docs/references/avatars/get-image.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE + )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -287,13 +303,16 @@ App::get('/v1/avatars/favicon') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/favicon') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFavicon') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-favicon.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFavicon', + description: '/docs/references/avatars/get-favicon.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE + )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') ->action(function (string $url, Response $response) { @@ -430,13 +449,16 @@ App::get('/v1/avatars/qr') ->desc('Get QR code') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getQR') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-qr.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getQR', + description: '/docs/references/avatars/get-qr.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) @@ -471,13 +493,16 @@ App::get('/v1/avatars/initials') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache.resource', 'avatar/initials') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getInitials') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-initials.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getInitials', + description: '/docs/references/avatars/get-initials.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index eeb823a3d3..0ed74b8625 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -1,6 +1,9 @@ desc('Get variables') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'console') - ->label('sdk.method', 'variables') - ->label('sdk.description', '/docs/references/console/variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES) + ->label('sdk', new Method( + namespace: 'console', + name: 'variables', + description: '/docs/references/console/variables.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CONSOLE_VARIABLES, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $isDomainEnabled = !empty(System::getEnv('_APP_DOMAIN', '')) @@ -60,12 +65,15 @@ App::post('/v1/console/assistant') ->desc('Ask query') ->groups(['api', 'assistant']) ->label('scope', 'assistant.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'assistant') - ->label('sdk.method', 'chat') - ->label('sdk.description', '/docs/references/assistant/chat.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_TEXT) + ->label('sdk', new Method( + namespace: 'assistant', + name: 'chat', + description: '/docs/references/assistant/chat.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::TEXT + )) ->label('abuse-limit', 15) ->label('abuse-key', 'userId:{userId}') ->param('prompt', '', new Text(2000), 'Prompt. A string containing questions asked to the AI assistant.') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4de4c4420e..cf5997619a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -7,6 +7,9 @@ use Appwrite\Event\Event; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -448,13 +451,15 @@ App::post('/v1/databases') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'database.create') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/databases/create.md') // create this file later - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) // Model for database needs to be created + ->label('sdk', new Method( + namespace: 'databases', + name: 'create', + description: '/docs/references/databases/create.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -524,13 +529,15 @@ App::get('/v1/databases') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/databases/list.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'list', + description: '/docs/references/databases/list.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -580,13 +587,15 @@ App::get('/v1/databases/:databaseId') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/databases/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'get', + description: '/docs/references/databases/get.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -606,13 +615,15 @@ App::get('/v1/databases/:databaseId/logs') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/databases/get-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listLogs', + description: '/docs/references/databases/get-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -701,13 +712,15 @@ App::put('/v1/databases/:databaseId') ->label('event', 'databases.[databaseId].update') ->label('audits.event', 'database.update') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/databases/update.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'update', + description: '/docs/references/databases/update.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -740,12 +753,14 @@ App::delete('/v1/databases/:databaseId') ->label('event', 'databases.[databaseId].delete') ->label('audits.event', 'database.delete') ->label('audits.resource', 'database/{request.databaseId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/databases/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'delete', + description: '/docs/references/databases/delete.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -789,13 +804,15 @@ App::post('/v1/databases/:databaseId/collections') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'collection.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createCollection') - ->label('sdk.description', '/docs/references/databases/create-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createCollection', + description: '/docs/references/databases/create-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') @@ -854,13 +871,15 @@ App::get('/v1/databases/:databaseId/collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollections') - ->label('sdk.description', '/docs/references/databases/list-collections.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollections', + description: '/docs/references/databases/list-collections.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -920,13 +939,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollection') - ->label('sdk.description', '/docs/references/databases/get-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollection', + description: '/docs/references/databases/get-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -955,13 +976,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollectionLogs') - ->label('sdk.description', '/docs/references/databases/get-collection-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollectionLogs', + description: '/docs/references/databases/get-collection-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -1054,13 +1077,15 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') ->label('event', 'databases.[databaseId].collections.[collectionId].update') ->label('audits.event', 'collection.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateCollection') - ->label('sdk.description', '/docs/references/databases/update-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateCollection', + description: '/docs/references/databases/update-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') @@ -1122,12 +1147,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') ->label('event', 'databases.[databaseId].collections.[collectionId].delete') ->label('audits.event', 'collection.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteCollection') - ->label('sdk.description', '/docs/references/databases/delete-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteCollection', + description: '/docs/references/databases/delete-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -1178,13 +1205,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createStringAttribute') - ->label('sdk.description', '/docs/references/databases/create-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createStringAttribute', + description: '/docs/references/databases/create-string-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_STRING, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1235,13 +1264,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEmailAttribute') - ->label('sdk.description', '/docs/references/databases/create-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEmailAttribute', + description: '/docs/references/databases/create-email-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1278,13 +1309,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEnumAttribute') - ->label('sdk.description', '/docs/references/databases/create-attribute-enum.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEnumAttribute', + description: '/docs/references/databases/create-attribute-enum.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1326,13 +1359,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIpAttribute') - ->label('sdk.description', '/docs/references/databases/create-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIpAttribute', + description: '/docs/references/databases/create-ip-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_IP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1369,13 +1404,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createUrlAttribute') - ->label('sdk.description', '/docs/references/databases/create-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createUrlAttribute', + description: '/docs/references/databases/create-url-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_URL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1412,13 +1449,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/create-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIntegerAttribute', + description: '/docs/references/databases/create-integer-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1484,13 +1523,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createFloatAttribute') - ->label('sdk.description', '/docs/references/databases/create-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createFloatAttribute', + description: '/docs/references/databases/create-float-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1554,13 +1595,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/create-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createBooleanAttribute', + description: '/docs/references/databases/create-boolean-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1596,13 +1639,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/create-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createDatetimeAttribute', + description: '/docs/references/databases/create-datetime-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1641,13 +1686,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/create-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createRelationshipAttribute', + description: '/docs/references/databases/create-relationship-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('relatedCollectionId', '', new UID(), 'Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1767,13 +1814,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listAttributes') - ->label('sdk.description', '/docs/references/databases/list-attributes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listAttributes', + description: '/docs/references/databases/list-attributes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Attributes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Attributes::ALLOWED_ATTRIBUTES), true) @@ -1848,23 +1897,26 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getAttribute') - ->label('sdk.description', '/docs/references/databases/get-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING])// needs to be last, since its condition would dominate any other string attribute + ->label('sdk', new Method( + namespace: 'databases', + name: 'getAttribute', + description: '/docs/references/databases/get-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: [ + Response::MODEL_ATTRIBUTE_BOOLEAN, + Response::MODEL_ATTRIBUTE_INTEGER, + Response::MODEL_ATTRIBUTE_FLOAT, + Response::MODEL_ATTRIBUTE_EMAIL, + Response::MODEL_ATTRIBUTE_ENUM, + Response::MODEL_ATTRIBUTE_URL, + Response::MODEL_ATTRIBUTE_IP, + Response::MODEL_ATTRIBUTE_DATETIME, + Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_STRING + ], + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1926,12 +1978,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateStringAttribute') - ->label('sdk.description', '/docs/references/databases/update-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateStringAttribute', + description: '/docs/references/databases/update-string-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_STRING, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1970,12 +2025,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEmailAttribute') - ->label('sdk.description', '/docs/references/databases/update-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEmailAttribute', + description: '/docs/references/databases/update-email-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2012,12 +2070,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEnumAttribute') - ->label('sdk.description', '/docs/references/databases/update-enum-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEnumAttribute', + description: '/docs/references/databases/update-enum-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2056,12 +2117,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIpAttribute') - ->label('sdk.description', '/docs/references/databases/update-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIpAttribute', + description: '/docs/references/databases/update-ip-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_IP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2098,12 +2162,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateUrlAttribute') - ->label('sdk.description', '/docs/references/databases/update-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateUrlAttribute', + description: '/docs/references/databases/update-url-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_URL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2140,12 +2207,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/update-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIntegerAttribute', + description: '/docs/references/databases/update-integer-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2192,12 +2262,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateFloatAttribute') - ->label('sdk.description', '/docs/references/databases/update-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateFloatAttribute', + description: '/docs/references/databases/update-float-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2244,12 +2317,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/update-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateBooleanAttribute', + description: '/docs/references/databases/update-boolean-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2285,12 +2361,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/update-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDatetimeAttribute', + description: '/docs/references/databases/update-datetime-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2326,12 +2405,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/update-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateRelationshipAttribute', + description: '/docs/references/databases/update-relationship-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2384,12 +2466,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteAttribute') - ->label('sdk.description', '/docs/references/databases/delete-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteAttribute', + description: '/docs/references/databases/delete-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2498,13 +2582,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'index.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createIndex') - ->label('sdk.description', '/docs/references/databases/create-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIndex', + description: '/docs/references/databases/create-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_INDEX, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2666,13 +2752,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listIndexes') - ->label('sdk.description', '/docs/references/databases/list-indexes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listIndexes', + description: '/docs/references/databases/list-indexes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_INDEX_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) @@ -2742,13 +2830,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getIndex') - ->label('sdk.description', '/docs/references/databases/get-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getIndex', + description: '/docs/references/databases/get-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_INDEX, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2785,12 +2875,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].update') ->label('audits.event', 'index.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteIndex') - ->label('sdk.description', '/docs/references/databases/delete-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteIndex', + description: '/docs/references/databases/delete-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Index Key.') @@ -2854,6 +2946,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'databases') + //TODO: Deal with SDK Multiplexing later - B/S ->label('sdk.method', [ 'createDocument' => [ 'name' => 'Create Document', @@ -3164,14 +3257,16 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocuments') - ->label('sdk.description', '/docs/references/databases/list-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocuments', + description: '/docs/references/databases/list-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) @@ -3319,15 +3414,17 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDocument') - ->label('sdk.description', '/docs/references/databases/get-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDocument', + description: '/docs/references/databases/get-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -3412,13 +3509,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocumentLogs') - ->label('sdk.description', '/docs/references/databases/get-document-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocumentLogs', + description: '/docs/references/databases/get-document-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3523,15 +3622,17 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->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.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDocument') - ->label('sdk.description', '/docs/references/databases/update-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDocument', + description: '/docs/references/databases/update-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3760,14 +3861,16 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->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.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDocuments') - ->label('sdk.description', '/docs/references/databases/update-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDocuments', + description: '/docs/references/databases/update-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) @@ -3897,14 +4000,16 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteDocument') - ->label('sdk.description', '/docs/references/databases/delete-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteDocument', + description: '/docs/references/databases/delete-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -4015,15 +4120,17 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteDocuments') - ->label('sdk.description', '/docs/references/databases/delete-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteDocuments', + description: '/docs/references/databases/delete-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) @@ -4119,12 +4226,15 @@ App::get('/v1/databases/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getUsage', + description: '/docs/references/databases/get-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_DATABASES, + responseType: ResponseType::JSON, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') ->inject('dbForProject') @@ -4201,12 +4311,15 @@ App::get('/v1/databases/:databaseId/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDatabaseUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDatabaseUsage', + description: '/docs/references/databases/get-database-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_DATABASE, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4289,12 +4402,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollectionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollectionUsage', + description: '/docs/references/databases/get-collection-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_COLLECTION, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 2309defe5a..1d485538ee 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -14,6 +14,10 @@ use Appwrite\Functions\Validator\Headers; use Appwrite\Functions\Validator\RuntimeSpecification; use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; @@ -141,13 +145,15 @@ App::post('/v1/functions') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'function.create') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/functions/create-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'create', + description: '/docs/references/functions/create-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.') @@ -402,13 +408,15 @@ App::get('/v1/functions') ->desc('List functions') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/functions/list-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'list', + description: '/docs/references/functions/list-functions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -463,13 +471,15 @@ App::get('/v1/functions/runtimes') ->desc('List runtimes') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listRuntimes') - ->label('sdk.description', '/docs/references/functions/list-runtimes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RUNTIME_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listRuntimes', + description: '/docs/references/functions/list-runtimes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_RUNTIME_LIST, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $runtimes = Config::getParam('runtimes'); @@ -497,13 +507,15 @@ App::get('/v1/functions/specifications') ->desc('List available function runtime specifications') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listSpecifications') - ->label('sdk.description', '/docs/references/functions/list-specifications.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SPECIFICATION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listSpecifications', + description: '/docs/references/functions/list-specifications.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SPECIFICATION_LIST, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('plan') ->action(function (Response $response, array $plan) { @@ -534,13 +546,15 @@ App::get('/v1/functions/:functionId') ->desc('Get function') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/functions/get-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'get', + description: '/docs/references/functions/get-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') @@ -559,12 +573,15 @@ App::get('/v1/functions/:functionId/usage') ->groups(['api', 'functions', 'usage']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getFunctionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getFunctionUsage', + description: '/docs/references/functions/get-function-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') @@ -664,12 +681,15 @@ App::get('/v1/functions/usage') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getUsage', + description: '/docs/references/functions/get-functions-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_FUNCTIONS, + responseType: ResponseType::JSON + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -767,13 +787,15 @@ App::put('/v1/functions/:functionId') ->label('event', 'functions.[functionId].update') ->label('audits.event', 'function.update') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/functions/update-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'update', + description: '/docs/references/functions/update-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true) @@ -967,13 +989,16 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') ->desc('Download deployment') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeploymentDownload') - ->label('sdk.description', '/docs/references/functions/get-deployment-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeploymentDownload', + description: '/docs/references/functions/get-deployment-download.md', + auth: [AuthType::KEY, AuthType::JWT], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + methodType: MethodType::LOCATION + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1056,13 +1081,15 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeployment') - ->label('sdk.description', '/docs/references/functions/update-function-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeployment', + description: '/docs/references/functions/update-function-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1119,12 +1146,14 @@ App::delete('/v1/functions/:functionId') ->label('event', 'functions.[functionId].delete') ->label('audits.event', 'function.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/functions/delete-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'delete', + description: '/docs/references/functions/delete-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') @@ -1167,16 +1196,18 @@ App::post('/v1/functions/:functionId/deployments') ->label('event', 'functions.[functionId].deployments.[deploymentId].create') ->label('audits.event', 'deployment.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createDeployment') - ->label('sdk.methodType', 'upload') - ->label('sdk.description', '/docs/references/functions/create-deployment.md') - ->label('sdk.packaging', true) - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createDeployment', + description: '/docs/references/functions/create-deployment.md', + auth: [AuthType::KEY], + requestType: 'multipart/form-data', + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_DEPLOYMENT, + responseType: ResponseType::JSON, + methodType: MethodType::UPLOAD, + packaging: true, + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('entrypoint', null, new Text(1028), 'Entrypoint File.', true) ->param('commands', null, new Text(8192, 0), 'Build Commands.', true) @@ -1384,13 +1415,15 @@ App::get('/v1/functions/:functionId/deployments') ->desc('List deployments') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listDeployments') - ->label('sdk.description', '/docs/references/functions/list-deployments.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listDeployments', + description: '/docs/references/functions/list-deployments.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DEPLOYMENT_LIST, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1468,13 +1501,15 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') ->desc('Get deployment') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeployment') - ->label('sdk.description', '/docs/references/functions/get-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeployment', + description: '/docs/references/functions/get-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DEPLOYMENT, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1515,12 +1550,14 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') ->label('event', 'functions.[functionId].deployments.[deploymentId].delete') ->label('audits.event', 'deployment.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteDeployment') - ->label('sdk.description', '/docs/references/functions/delete-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteDeployment', + description: '/docs/references/functions/delete-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1581,11 +1618,14 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createBuild') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createBuild', + description: '/docs/references/functions/create-deployment-build.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->param('buildId', '', new UID(), 'Build unique ID.', true) // added as optional param for backward compatibility @@ -1648,13 +1688,16 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('scope', 'functions.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'deployment.update') - ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeploymentBuild') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUILD) + ->label('audits.resource', 'function/{request.functionId}') + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeploymentBuild', + description: '/docs/references/functions/update-deployment-build.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUILD, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1738,15 +1781,16 @@ App::post('/v1/functions/:functionId/executions') ->label('scope', 'execution.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].executions.[executionId].create') - ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createExecution') - ->label('sdk.description', '/docs/references/functions/create-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_MULTIPART) - ->label('sdk.response.model', Response::MODEL_EXECUTION) - ->label('sdk.request.type', Response::CONTENT_TYPE_JSON) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::MULTIPART, + responseModel: Response::MODEL_EXECUTION, + requestType: 'application/json', + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true) ->param('async', false, new Boolean(true), 'Execute code in the background. Default value is false.', true) @@ -2141,13 +2185,15 @@ App::get('/v1/functions/:functionId/executions') ->desc('List executions') ->label('scope', 'execution.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listExecutions') - ->label('sdk.description', '/docs/references/functions/list-executions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listExecutions', + description: '/docs/references/functions/list-executions.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_EXECUTION_LIST + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2229,13 +2275,15 @@ App::get('/v1/functions/:functionId/executions/:executionId') ->desc('Get execution') ->label('scope', 'execution.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getExecution') - ->label('sdk.description', '/docs/references/functions/get-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getExecution', + description: '/docs/references/functions/get-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_EXECUTION + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') @@ -2280,12 +2328,14 @@ App::delete('/v1/functions/:functionId/executions/:executionId') ->label('event', 'functions.[functionId].executions.[executionId].delete') ->label('audits.event', 'executions.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteExecution') - ->label('sdk.description', '/docs/references/functions/delete-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteExecution', + description: '/docs/references/functions/delete-execution.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') @@ -2350,13 +2400,15 @@ App::post('/v1/functions/:functionId/variables') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/functions/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createVariable', + description: '/docs/references/functions/create-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) @@ -2412,14 +2464,17 @@ App::get('/v1/functions/:functionId/variables') ->desc('List variables') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/functions/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('sdk', + new Method( + namespace: 'functions', + name: 'listVariables', + description: '/docs/references/functions/list-variables.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE_LIST + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->inject('response') ->inject('dbForProject') @@ -2441,13 +2496,16 @@ App::get('/v1/functions/:functionId/variables/:variableId') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/functions/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getVariable', + description: '/docs/references/functions/get-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -2483,13 +2541,15 @@ App::put('/v1/functions/:functionId/variables/:variableId') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/functions/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateVariable', + description: '/docs/references/functions/update-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) @@ -2545,12 +2605,14 @@ App::delete('/v1/functions/:functionId/variables/:variableId') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/functions/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteVariable', + description: '/docs/references/functions/delete-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -2592,13 +2654,15 @@ App::get('/v1/functions/templates') ->desc('List function templates') ->label('scope', 'public') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listTemplates') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/list-templates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listTemplates', + description: '/docs/references/functions/list-templates.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TEMPLATE_FUNCTION_LIST + )) ->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true) ->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true) ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) @@ -2630,13 +2694,15 @@ App::get('/v1/functions/templates/:templateId') ->desc('Get function template') ->label('scope', 'public') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getTemplate') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/get-template.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getTemplate', + description: '/docs/references/functions/get-template.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TEMPLATE_FUNCTION + )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') ->action(function (string $templateId, Response $response) { diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index f79f433b5c..6d34a8c70a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -5,6 +5,10 @@ use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\GraphQL\Promises\Adapter; use Appwrite\GraphQL\Schema; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use GraphQL\Error\DebugFlag; @@ -38,13 +42,16 @@ App::get('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.hide', true) - ->label('sdk.description', '/docs/references/graphql/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'get', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + hide: true, + description: '/docs/references/graphql/get.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->param('query', '', new Text(0, 0), 'The query to execute.') @@ -78,17 +85,19 @@ App::post('/v1/graphql/mutation') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'mutation') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'mutation', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY, + methodType: MethodType::GRAPHQL, + parameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') @@ -123,17 +132,19 @@ App::post('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'query') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'query', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY, + methodType: MethodType::GRAPHQL, + parameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 60a8c0ca97..379afd34fc 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -3,6 +3,9 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -26,13 +29,15 @@ App::get('/v1/health') ->desc('Get HTTP') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/health/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + namespace: 'health', + name: 'get', + auth: [AuthType::KEY], + description: '/docs/references/health/get.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -49,9 +54,15 @@ App::get('/v1/health/version') ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_VERSION) + ->label('sdk', new Method( + namespace: 'health', + name: 'getVersion', + description: '/docs/references/health/get-version.md', + auth: [], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_VERSION, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION); @@ -61,13 +72,15 @@ App::get('/v1/health/db') ->desc('Get DB') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getDB') - ->label('sdk.description', '/docs/references/health/get-db.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getDB', + description: '/docs/references/health/get-db.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -115,13 +128,15 @@ App::get('/v1/health/cache') ->desc('Get cache') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCache') - ->label('sdk.description', '/docs/references/health/get-cache.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCache', + description: '/docs/references/health/get-cache.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -173,13 +188,15 @@ App::get('/v1/health/queue') ->desc('Get queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueue') - ->label('sdk.description', '/docs/references/health/get-queue.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueue', + description: '/docs/references/health/get-queue.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -230,13 +247,15 @@ App::get('/v1/health/pubsub') ->desc('Get pubsub') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getPubSub') - ->label('sdk.description', '/docs/references/health/get-pubsub.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getPubSub', + description: '/docs/references/health/get-pubsub.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -288,13 +307,15 @@ App::get('/v1/health/time') ->desc('Get time') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getTime') - ->label('sdk.description', '/docs/references/health/get-time.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_TIME) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getTime', + description: '/docs/references/health/get-time.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_TIME, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -345,13 +366,15 @@ App::get('/v1/health/queue/webhooks') ->desc('Get webhooks queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueWebhooks') - ->label('sdk.description', '/docs/references/health/get-queue-webhooks.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueWebhooks', + description: '/docs/references/health/get-queue-webhooks.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -372,13 +395,15 @@ App::get('/v1/health/queue/logs') ->desc('Get logs queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueLogs') - ->label('sdk.description', '/docs/references/health/get-queue-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueLogs', + description: '/docs/references/health/get-queue-logs.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -399,13 +424,15 @@ App::get('/v1/health/certificate') ->desc('Get the SSL certificate for a domain') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCertificate') - ->label('sdk.description', '/docs/references/health/get-certificate.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_CERTIFICATE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCertificate', + description: '/docs/references/health/get-certificate.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_CERTIFICATE, + responseType: ResponseType::JSON + )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') ->action(function (string $domain, Response $response) { @@ -449,13 +476,15 @@ App::get('/v1/health/queue/certificates') ->desc('Get certificates queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueCertificates') - ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueCertificates', + description: '/docs/references/health/get-queue-certificates.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -476,13 +505,15 @@ App::get('/v1/health/queue/builds') ->desc('Get builds queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueBuilds') - ->label('sdk.description', '/docs/references/health/get-queue-builds.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueBuilds', + description: '/docs/references/health/get-queue-builds.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -503,13 +534,15 @@ App::get('/v1/health/queue/databases') ->desc('Get databases queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDatabases') - ->label('sdk.description', '/docs/references/health/get-queue-databases.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDatabases', + description: '/docs/references/health/get-queue-databases.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -531,13 +564,15 @@ App::get('/v1/health/queue/deletes') ->desc('Get deletes queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDeletes') - ->label('sdk.description', '/docs/references/health/get-queue-deletes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDeletes', + description: '/docs/references/health/get-queue-deletes.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -558,13 +593,15 @@ App::get('/v1/health/queue/mails') ->desc('Get mails queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMails') - ->label('sdk.description', '/docs/references/health/get-queue-mails.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMails', + description: '/docs/references/health/get-queue-mails.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -585,13 +622,15 @@ App::get('/v1/health/queue/messaging') ->desc('Get messaging queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMessaging') - ->label('sdk.description', '/docs/references/health/get-queue-messaging.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMessaging', + description: '/docs/references/health/get-queue-messaging.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -612,13 +651,15 @@ App::get('/v1/health/queue/migrations') ->desc('Get migrations queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMigrations') - ->label('sdk.description', '/docs/references/health/get-queue-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMigrations', + description: '/docs/references/health/get-queue-migrations.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -639,13 +680,15 @@ App::get('/v1/health/queue/functions') ->desc('Get functions queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueFunctions') - ->label('sdk.description', '/docs/references/health/get-queue-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueFunctions', + description: '/docs/references/health/get-queue-functions.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -666,13 +709,15 @@ App::get('/v1/health/queue/usage') ->desc('Get usage queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsage') - ->label('sdk.description', '/docs/references/health/get-queue-usage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsage', + description: '/docs/references/health/get-queue-usage.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -693,13 +738,15 @@ App::get('/v1/health/queue/usage-dump') ->desc('Get usage dump queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsageDump') - ->label('sdk.description', '/docs/references/health/get-queue-usage-dump.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsageDump', + description: '/docs/references/health/get-queue-usage-dump.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -720,13 +767,15 @@ App::get('/v1/health/storage/local') ->desc('Get local storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorageLocal') - ->label('sdk.description', '/docs/references/health/get-storage-local.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorageLocal', + description: '/docs/references/health/get-storage-local.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -763,13 +812,15 @@ App::get('/v1/health/storage') ->desc('Get storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorage') - ->label('sdk.description', '/docs/references/health/get-storage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorage', + description: '/docs/references/health/get-storage.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('deviceForFiles') ->inject('deviceForFunctions') @@ -804,13 +855,15 @@ App::get('/v1/health/anti-virus') ->desc('Get antivirus') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getAntivirus') - ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_ANTIVIRUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getAntivirus', + description: '/docs/references/health/get-storage-anti-virus.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_ANTIVIRUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -843,9 +896,15 @@ App::get('/v1/health/queue/failed/:name') ->desc('Get number of failed queue jobs') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getFailedJobs') + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getFailedJobs', + description: '/docs/references/health/get-failed-queue-jobs.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('name', '', new WhiteList([ Event::DATABASE_QUEUE_NAME, Event::DELETE_QUEUE_NAME, @@ -861,10 +920,6 @@ App::get('/v1/health/queue/failed/:name') Event::MIGRATIONS_QUEUE_NAME ]), 'The name of the queue') ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->label('sdk.description', '/docs/references/health/get-failed-queue-jobs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) ->inject('response') ->inject('queue') ->action(function (string $name, int|string $threshold, Response $response, Connection $queue) { diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 1f042d2239..c918d666a0 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -1,5 +1,8 @@ desc('Get user locale') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/locale/get-locale.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE) - ->label('sdk.offline.model', '/localed') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'get', + description: '/docs/references/locale/get-locale.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOCALE, + responseType: ResponseType::JSON, + offlineKey: 'current', + offlineModel: '/localed', + )) ->inject('request') ->inject('response') ->inject('locale') @@ -72,15 +77,17 @@ App::get('/v1/locale/codes') ->desc('List locale codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCodes') - ->label('sdk.description', '/docs/references/locale/list-locale-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE_CODE_LIST) - ->label('sdk.offline.model', '/locale/localeCode') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCodes', + description: '/docs/references/locale/list-locale-codes.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOCALE_CODE_LIST, + responseType: ResponseType::JSON, + offlineKey: 'current', + offlineModel: '/locale/localeCode', + )) ->inject('response') ->action(function (Response $response) { $codes = Config::getParam('locale-codes'); @@ -94,15 +101,17 @@ App::get('/v1/locale/countries') ->desc('List countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountries') - ->label('sdk.description', '/docs/references/locale/list-countries.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountries', + description: '/docs/references/locale/list-countries.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COUNTRY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -127,15 +136,17 @@ App::get('/v1/locale/countries/eu') ->desc('List EU countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesEU') - ->label('sdk.description', '/docs/references/locale/list-countries-eu.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries/eu') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesEU', + description: '/docs/references/locale/list-countries-eu.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COUNTRY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries/eu', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -162,15 +173,17 @@ App::get('/v1/locale/countries/phones') ->desc('List countries phone codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesPhones') - ->label('sdk.description', '/docs/references/locale/list-countries-phones.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PHONE_LIST) - ->label('sdk.offline.model', '/locale/countries/phones') - ->label('sdk.offline.response.key', 'countryCode') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesPhones', + description: '/docs/references/locale/list-countries-phones.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PHONE_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries/phones', + offlineResponseKey: 'countryCode' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -196,15 +209,17 @@ App::get('/v1/locale/continents') ->desc('List continents') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listContinents') - ->label('sdk.description', '/docs/references/locale/list-continents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONTINENT_LIST) - ->label('sdk.offline.model', '/locale/continents') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listContinents', + description: '/docs/references/locale/list-continents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CONTINENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/continents', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -228,15 +243,17 @@ App::get('/v1/locale/currencies') ->desc('List currencies') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCurrencies') - ->label('sdk.description', '/docs/references/locale/list-currencies.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CURRENCY_LIST) - ->label('sdk.offline.model', '/locale/currencies') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCurrencies', + description: '/docs/references/locale/list-currencies.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CURRENCY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/currencies', + offlineResponseKey: 'code' + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-currencies'); @@ -251,15 +268,17 @@ App::get('/v1/locale/languages') ->desc('List languages') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listLanguages') - ->label('sdk.description', '/docs/references/locale/list-languages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST) - ->label('sdk.offline.model', '/locale/languages') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listLanguages', + description: '/docs/references/locale/list-languages.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LANGUAGE_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/languages', + offlineResponseKey: 'code' + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-languages'); diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index e4a627d027..fbeb38e355 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -11,6 +11,9 @@ use Appwrite\Messaging\Status as MessageStatus; use Appwrite\Network\Validator\Email; use Appwrite\Permission; use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -20,6 +23,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Targets; use Appwrite\Utopia\Database\Validator\Queries\Topics; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; +use Tests\Unit\Auth\AuthTest; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Database\Database; @@ -57,13 +61,15 @@ App::post('/v1/messaging/providers/mailgun') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/create-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMailgunProvider', + description: '/docs/references/messaging/create-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -145,13 +151,15 @@ App::post('/v1/messaging/providers/sendgrid') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/create-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSendgridProvider', + description: '/docs/references/messaging/create-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Sendgrid API key.', true) @@ -221,13 +229,15 @@ App::post('/v1/messaging/providers/smtp') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/create-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSmtpProvider', + description: '/docs/references/messaging/create-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.') @@ -310,13 +320,15 @@ App::post('/v1/messaging/providers/msg91') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) ->label('event', 'providers.[providerId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/create-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMsg91Provider', + description: '/docs/references/messaging/create-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('templateId', '', new Text(0), 'Msg91 template ID', true) @@ -387,13 +399,15 @@ App::post('/v1/messaging/providers/telesign') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/create-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTelesignProvider', + description: '/docs/references/messaging/create-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -465,13 +479,15 @@ App::post('/v1/messaging/providers/textmagic') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/create-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTextmagicProvider', + description: '/docs/references/messaging/create-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -543,13 +559,15 @@ App::post('/v1/messaging/providers/twilio') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/create-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTwilioProvider', + description: '/docs/references/messaging/create-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -621,13 +639,15 @@ App::post('/v1/messaging/providers/vonage') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createVonageProvider') - ->label('sdk.description', '/docs/references/messaging/create-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createVonageProvider', + description: '/docs/references/messaging/create-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -699,13 +719,15 @@ App::post('/v1/messaging/providers/fcm') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createFcmProvider') - ->label('sdk.description', '/docs/references/messaging/create-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createFcmProvider', + description: '/docs/references/messaging/create-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('serviceAccountJSON', null, new JSON(), 'FCM service account JSON.', true) @@ -763,13 +785,15 @@ App::post('/v1/messaging/providers/apns') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createApnsProvider') - ->label('sdk.description', '/docs/references/messaging/create-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createApnsProvider', + description: '/docs/references/messaging/create-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('authKey', '', new Text(0), 'APNS authentication key.', true) @@ -847,13 +871,15 @@ App::get('/v1/messaging/providers') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviders') - ->label('sdk.description', '/docs/references/messaging/list-providers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviders', + description: '/docs/references/messaging/list-providers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER_LIST + )) ->param('queries', [], new Providers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -904,13 +930,15 @@ App::get('/v1/messaging/providers/:providerId/logs') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviderLogs') - ->label('sdk.description', '/docs/references/messaging/list-provider-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviderLogs', + description: '/docs/references/messaging/list-provider-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -993,13 +1021,15 @@ App::get('/v1/messaging/providers/:providerId') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getProvider') - ->label('sdk.description', '/docs/references/messaging/get-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getProvider', + description: '/docs/references/messaging/get-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('dbForProject') ->inject('response') @@ -1021,13 +1051,15 @@ App::patch('/v1/messaging/providers/mailgun/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/update-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMailgunProvider', + description: '/docs/references/messaging/update-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -1128,13 +1160,15 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/update-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSendgridProvider', + description: '/docs/references/messaging/update-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1220,13 +1254,15 @@ App::patch('/v1/messaging/providers/smtp/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/update-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSmtpProvider', + description: '/docs/references/messaging/update-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.', true) @@ -1343,13 +1379,15 @@ App::patch('/v1/messaging/providers/msg91/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/update-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMsg91Provider', + description: '/docs/references/messaging/update-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1424,13 +1462,15 @@ App::patch('/v1/messaging/providers/telesign/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/update-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTelesignProvider', + description: '/docs/references/messaging/update-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1507,13 +1547,15 @@ App::patch('/v1/messaging/providers/textmagic/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/update-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTextmagicProvider', + description: '/docs/references/messaging/update-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1590,13 +1632,15 @@ App::patch('/v1/messaging/providers/twilio/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/update-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTwilioProvider', + description: '/docs/references/messaging/update-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1673,13 +1717,15 @@ App::patch('/v1/messaging/providers/vonage/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateVonageProvider') - ->label('sdk.description', '/docs/references/messaging/update-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateVonageProvider', + description: '/docs/references/messaging/update-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1756,13 +1802,15 @@ App::patch('/v1/messaging/providers/fcm/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateFcmProvider') - ->label('sdk.description', '/docs/references/messaging/update-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateFcmProvider', + description: '/docs/references/messaging/update-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1826,13 +1874,15 @@ App::patch('/v1/messaging/providers/apns/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateApnsProvider') - ->label('sdk.description', '/docs/references/messaging/update-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateApnsProvider', + description: '/docs/references/messaging/update-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1922,13 +1972,15 @@ App::delete('/v1/messaging/providers/:providerId') ->label('event', 'providers.[providerId].delete') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteProvider') - ->label('sdk.description', '/docs/references/messaging/delete-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteProvider', + description: '/docs/references/messaging/delete-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -1958,13 +2010,15 @@ App::post('/v1/messaging/topics') ->label('event', 'topics.[topicId].create') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTopic') - ->label('sdk.description', '/docs/references/messaging/create-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTopic', + description: '/docs/references/messaging/create-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new CustomId(), 'Topic ID. Choose a custom Topic ID or a new Topic ID.') ->param('name', '', new Text(128), 'Topic Name.') ->param('subscribe', [Role::users()], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -1999,13 +2053,15 @@ App::get('/v1/messaging/topics') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopics') - ->label('sdk.description', '/docs/references/messaging/list-topics.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopics', + description: '/docs/references/messaging/list-topics.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC_LIST + )) ->param('queries', [], new Topics(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Topics::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -2056,13 +2112,15 @@ App::get('/v1/messaging/topics/:topicId/logs') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopicLogs') - ->label('sdk.description', '/docs/references/messaging/list-topic-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopicLogs', + description: '/docs/references/messaging/list-topic-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2146,13 +2204,15 @@ App::get('/v1/messaging/topics/:topicId') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getTopic') - ->label('sdk.description', '/docs/references/messaging/get-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getTopic', + description: '/docs/references/messaging/get-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('dbForProject') ->inject('response') @@ -2175,13 +2235,15 @@ App::patch('/v1/messaging/topics/:topicId') ->label('event', 'topics.[topicId].update') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTopic') - ->label('sdk.description', '/docs/references/messaging/update-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTopic', + description: '/docs/references/messaging/update-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('name', null, new Text(128), 'Topic Name.', true) ->param('subscribe', null, new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -2220,13 +2282,15 @@ App::delete('/v1/messaging/topics/:topicId') ->label('event', 'topics.[topicId].delete') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteTopic') - ->label('sdk.description', '/docs/references/messaging/delete-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteTopic', + description: '/docs/references/messaging/delete-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -2261,13 +2325,15 @@ App::post('/v1/messaging/topics/:topicId/subscribers') ->label('event', 'topics.[topicId].subscribers.[subscriberId].create') ->label('scope', 'subscribers.write') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSubscriber') - ->label('sdk.description', '/docs/references/messaging/create-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSubscriber', + description: '/docs/references/messaging/create-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER + )) ->param('subscriberId', '', new CustomId(), 'Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.') ->param('topicId', '', new UID(), 'Topic ID. The topic ID to subscribe to.') ->param('targetId', '', new UID(), 'Target ID. The target ID to link to the specified Topic ID.') @@ -2355,13 +2421,15 @@ App::get('/v1/messaging/topics/:topicId/subscribers') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscribers') - ->label('sdk.description', '/docs/references/messaging/list-subscribers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscribers', + description: '/docs/references/messaging/list-subscribers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER_LIST + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('queries', [], new Subscribers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2435,13 +2503,15 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscriberLogs') - ->label('sdk.description', '/docs/references/messaging/list-subscriber-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscriberLogs', + description: '/docs/references/messaging/list-subscriber-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2525,13 +2595,15 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getSubscriber') - ->label('sdk.description', '/docs/references/messaging/get-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getSubscriber', + description: '/docs/references/messaging/get-subscriber.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('dbForProject') @@ -2568,13 +2640,15 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->label('event', 'topics.[topicId].subscribers.[subscriberId].delete') ->label('scope', 'subscribers.write') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteSubscriber') - ->label('sdk.description', '/docs/references/messaging/delete-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteSubscriber', + description: '/docs/references/messaging/delete-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('queueForEvents') @@ -2628,13 +2702,15 @@ App::post('/v1/messaging/messages/email') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createEmail') - ->label('sdk.description', '/docs/references/messaging/create-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createEmail', + description: '/docs/references/messaging/create-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') ->param('content', '', new Text(64230), 'Email Content.') @@ -2781,13 +2857,15 @@ App::post('/v1/messaging/messages/sms') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSms') - ->label('sdk.description', '/docs/references/messaging/create-sms.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSms', + description: '/docs/references/messaging/create-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -2898,13 +2976,15 @@ App::post('/v1/messaging/messages/push') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createPush') - ->label('sdk.description', '/docs/references/messaging/create-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createPush', + description: '/docs/references/messaging/create-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('title', '', new Text(256), 'Title for push notification.') ->param('body', '', new Text(64230), 'Body for push notification.') @@ -3072,13 +3152,15 @@ App::get('/v1/messaging/messages') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessages') - ->label('sdk.description', '/docs/references/messaging/list-messages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessages', + description: '/docs/references/messaging/list-messages.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE_LIST + )) ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -3129,13 +3211,15 @@ App::get('/v1/messaging/messages/:messageId/logs') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessageLogs') - ->label('sdk.description', '/docs/references/messaging/list-message-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessageLogs', + description: '/docs/references/messaging/list-message-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -3219,13 +3303,15 @@ App::get('/v1/messaging/messages/:messageId/targets') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/messaging/list-message-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTargets', + description: '/docs/references/messaging/list-message-targets.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET_LIST + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -3290,13 +3376,15 @@ App::get('/v1/messaging/messages/:messageId') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getMessage') - ->label('sdk.description', '/docs/references/messaging/get-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getMessage', + description: '/docs/references/messaging/get-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') ->inject('response') @@ -3318,13 +3406,15 @@ App::patch('/v1/messaging/messages/email/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateEmail', + description: '/docs/references/messaging/update-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3519,13 +3609,15 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSms') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSms', + description: '/docs/references/messaging/update-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3675,13 +3767,15 @@ App::patch('/v1/messaging/messages/push/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updatePush') - ->label('sdk.description', '/docs/references/messaging/update-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updatePush', + description: '/docs/references/messaging/update-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3914,13 +4008,14 @@ App::delete('/v1/messaging/messages/:messageId') ->label('event', 'messages.[messageId].delete') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/messaging/delete-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'delete', + description: '/docs/references/messaging/delete-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') ->inject('dbForConsole') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index bebb6ebaea..1fb18e1e15 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -6,6 +6,10 @@ use Appwrite\Event\Migration; use Appwrite\Extend\Exception; use Appwrite\Permission; use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -38,13 +42,15 @@ App::post('/v1/migrations/appwrite') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createAppwriteMigration') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createAppwriteMigration', + description: '/docs/references/migrations/migration-appwrite.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectId', '', new UID(), "Source's Project ID") @@ -93,13 +99,15 @@ App::post('/v1/migrations/firebase/oauth') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseOAuthMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseOAuthMigration', + description: '/docs/references/migrations/migration-firebase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project') ->inject('response') @@ -196,13 +204,15 @@ App::post('/v1/migrations/firebase') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseMigration', + description: '/docs/references/migrations/migration-firebase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -257,13 +267,15 @@ App::post('/v1/migrations/supabase') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createSupabaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-supabase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createSupabaseMigration', + description: '/docs/references/migrations/migration-supabase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') ->param('apiKey', '', new Text(512), 'Source\'s API Key') @@ -318,13 +330,15 @@ App::post('/v1/migrations/nhost') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createNHostMigration') - ->label('sdk.description', '/docs/references/migrations/migration-nhost.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createNHostMigration', + description: '/docs/references/migrations/migration-nhost.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') ->param('region', '', new Text(512), 'Source\'s Region') @@ -379,13 +393,15 @@ App::get('/v1/migrations') ->groups(['api', 'migrations']) ->desc('List migrations') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/migrations/list-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_LIST) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'list', + description: '/docs/references/migrations/list-migrations.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -438,13 +454,15 @@ App::get('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) ->desc('Get migration') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/migrations/get-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'get', + description: '/docs/references/migrations/get-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -462,13 +480,15 @@ App::get('/v1/migrations/appwrite/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Appwrite data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getAppwriteReport') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getAppwriteReport', + description: '/docs/references/migrations/migration-appwrite-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectID', '', new Text(512), "Source's Project ID") @@ -504,13 +524,15 @@ App::get('/v1/migrations/firebase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Firebase data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getFirebaseReport', + description: '/docs/references/migrations/migration-firebase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -551,13 +573,15 @@ App::get('/v1/migrations/firebase/report/oauth') ->groups(['api', 'migrations']) ->desc('Generate a report on Firebase data using OAuth') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReportOAuth') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getFirebaseReportOAuth', + description: '/docs/references/migrations/migration-firebase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID') ->inject('response') @@ -642,14 +666,17 @@ App::get('/v1/migrations/firebase/connect') ->desc('Authorize with Firebase') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseAuth', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::HTML, + hide: true, + methodType: MethodType::WEBAUTH + )) ->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients']) ->param('projectId', '', new UID(), 'Project ID') ->inject('response') @@ -796,13 +823,15 @@ App::get('/v1/migrations/firebase/projects') ->desc('List Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'listFirebaseProjects') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'listFirebaseProjects', + description: '/docs/references/migrations/migration-firebase-projects.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('response') ->inject('project') @@ -885,12 +914,15 @@ App::get('/v1/migrations/firebase/deauthorize') ->desc('Revoke Appwrite\'s authorization to access Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'deleteFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'deleteFirebaseAuth', + description: '/docs/references/migrations/migration-firebase-deauthorize.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('response') ->inject('dbForConsole') @@ -913,13 +945,15 @@ App::get('/v1/migrations/supabase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Supabase Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getSupabaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-supabase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getSupabaseReport', + description: '/docs/references/migrations/migration-supabase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.') ->param('apiKey', '', new Text(512), 'Source\'s API Key.') @@ -956,13 +990,15 @@ App::get('/v1/migrations/nhost/report') ->groups(['api', 'migrations']) ->desc('Generate a report on NHost Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getNHostReport') - ->label('sdk.description', '/docs/references/migrations/migration-nhost-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getNHostReport', + description: '/docs/references/migrations/migration-nhost-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain.') ->param('region', '', new Text(512), 'Source\'s Region.') @@ -1002,13 +1038,15 @@ App::patch('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].retry') ->label('audits.event', 'migration.retry') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'retry') - ->label('sdk.description', '/docs/references/migrations/retry-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'retry', + description: '/docs/references/migrations/retry-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -1047,12 +1085,15 @@ App::delete('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].delete') ->label('audits.event', 'migrationId.delete') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/migrations/delete-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'delete', + description: '/docs/references/migrations/delete-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 6053326308..1685a04152 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -1,6 +1,9 @@ desc('Get project usage stats') ->groups(['api', 'usage']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_PROJECT) + ->label('sdk', new Method( + namespace: 'project', + name: 'getUsage', + description: '/docs/references/project/get-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_PROJECT, + responseType: ResponseType::JSON, + )) ->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage') ->param('endDate', '', new DateTimeValidator(), 'End date for the usage') ->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true) @@ -313,13 +319,15 @@ App::post('/v1/project/variables') ->groups(['api']) ->label('scope', 'projects.write') ->label('audits.event', 'variable.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/project/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'createVariable', + description: '/docs/references/project/create-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) ->inject('project') @@ -367,13 +375,15 @@ App::get('/v1/project/variables') ->desc('List variables') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/project/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('sdk', new Method( + namespace: 'project', + name: 'listVariables', + description: '/docs/references/project/list-variables.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE_LIST, + responseType: ResponseType::JSON, + )) ->inject('response') ->inject('dbForProject') ->action(function (Response $response, Database $dbForProject) { @@ -392,13 +402,15 @@ App::get('/v1/project/variables/:variableId') ->desc('Get variable') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/project/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'getVariable', + description: '/docs/references/project/get-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('project') @@ -416,13 +428,15 @@ App::put('/v1/project/variables/:variableId') ->desc('Update variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/project/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'updateVariable', + description: '/docs/references/project/update-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true) @@ -462,12 +476,14 @@ App::delete('/v1/project/variables/:variableId') ->desc('Delete variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/project/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'project', + name: 'deleteVariable', + description: '/docs/references/project/delete-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') ->inject('response') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index df8b1cb07b..901b94f579 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -10,6 +10,9 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -62,12 +65,15 @@ App::post('/v1/projects') ->groups(['api', 'projects']) ->label('audits.event', 'projects.create') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'create') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'create', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') @@ -252,12 +258,15 @@ App::get('/v1/projects') ->desc('List projects') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'list') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'list', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -311,12 +320,15 @@ App::get('/v1/projects/:projectId') ->desc('Get project') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'get') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'get', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -335,12 +347,15 @@ App::patch('/v1/projects/:projectId') ->desc('Update project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'update') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'update', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) @@ -382,12 +397,15 @@ App::patch('/v1/projects/:projectId/team') ->desc('Update project team') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateTeam') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateTeam', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.') ->inject('response') @@ -450,12 +468,15 @@ App::patch('/v1/projects/:projectId/service') ->desc('Update service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') ->param('status', null, new Boolean(), 'Service status.') @@ -481,12 +502,15 @@ App::patch('/v1/projects/:projectId/service/all') ->desc('Update all service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatusAll', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'Service status.') ->inject('response') @@ -515,12 +539,15 @@ App::patch('/v1/projects/:projectId/api') ->desc('Update API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') ->param('status', null, new Boolean(), 'API status.') @@ -546,12 +573,15 @@ App::patch('/v1/projects/:projectId/api/all') ->desc('Update all API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatusAll', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') ->inject('response') @@ -580,12 +610,15 @@ App::patch('/v1/projects/:projectId/oauth2') ->desc('Update project OAuth2') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateOAuth2') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateOAuth2', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name') ->param('appId', null, new Text(256), 'Provider app ID. Max length: 256 chars.', true) @@ -624,12 +657,15 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') ->desc('Update project sessions emails') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSessionAlerts') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSessionAlerts', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.') ->inject('response') @@ -655,12 +691,15 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy') ->desc('Update project memberships privacy attributes') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateMembershipsPrivacy') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMembershipsPrivacy', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.') ->param('userEmail', true, new Boolean(true), 'Set to true to show email to members of a team.') @@ -690,12 +729,15 @@ App::patch('/v1/projects/:projectId/auth/limit') ->desc('Update project users limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthLimit', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') ->inject('response') @@ -721,12 +763,15 @@ App::patch('/v1/projects/:projectId/auth/duration') ->desc('Update project authentication duration') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthDuration') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthDuration', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.') ->inject('response') @@ -752,12 +797,15 @@ App::patch('/v1/projects/:projectId/auth/:method') ->desc('Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false) ->param('status', false, new Boolean(true), 'Set the status of this auth method.') @@ -786,12 +834,15 @@ App::patch('/v1/projects/:projectId/auth/password-history') ->desc('Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordHistory') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordHistory', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0') ->inject('response') @@ -817,12 +868,15 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') ->desc('Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordDictionary') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordDictionary', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.') ->inject('response') @@ -848,12 +902,15 @@ App::patch('/v1/projects/:projectId/auth/personal-data') ->desc('Enable or disable checking user passwords for similarity with their personal data.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePersonalDataCheck') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePersonalDataCheck', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.') ->inject('response') @@ -879,12 +936,15 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') ->desc('Update project user sessions limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthSessionsLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthSessionsLimit', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT) ->inject('response') @@ -910,12 +970,15 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') ->desc('Update the mock numbers for the project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateMockNumbers') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMockNumbers', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.') ->inject('response') @@ -950,11 +1013,15 @@ App::delete('/v1/projects/:projectId') ->groups(['api', 'projects']) ->label('audits.event', 'projects.delete') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'delete') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'delete', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('user') @@ -985,12 +1052,15 @@ App::post('/v1/projects/:projectId/webhooks') ->desc('Create webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') ->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true) @@ -1043,12 +1113,15 @@ App::get('/v1/projects/:projectId/webhooks') ->desc('List webhooks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listWebhooks') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listWebhooks', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1075,12 +1148,15 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Get webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1109,12 +1185,15 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Update webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') @@ -1168,12 +1247,15 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') ->desc('Update webhook signature key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhookSignature') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhookSignature', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1207,11 +1289,15 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Delete webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1246,12 +1332,15 @@ App::post('/v1/projects/:projectId/keys') ->desc('Create key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') @@ -1296,12 +1385,15 @@ App::get('/v1/projects/:projectId/keys') ->desc('List keys') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listKeys') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listKeys', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1328,12 +1420,15 @@ App::get('/v1/projects/:projectId/keys/:keyId') ->desc('Get key') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') @@ -1362,12 +1457,15 @@ App::put('/v1/projects/:projectId/keys/:keyId') ->desc('Update key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') @@ -1408,11 +1506,15 @@ App::delete('/v1/projects/:projectId/keys/:keyId') ->desc('Delete key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteKey') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') @@ -1447,12 +1549,15 @@ App::post('/v1/projects/:projectId/jwts') ->groups(['api', 'projects']) ->desc('Create JWT') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createJWT') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createJWT', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_JWT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) @@ -1483,12 +1588,15 @@ App::post('/v1/projects/:projectId/platforms') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.create') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createPlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1533,12 +1641,15 @@ App::get('/v1/projects/:projectId/platforms') ->desc('List platforms') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listPlatforms') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listPlatforms', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1565,12 +1676,15 @@ App::get('/v1/projects/:projectId/platforms/:platformId') ->desc('Get platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getPlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') @@ -1599,12 +1713,15 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->desc('Update platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1647,11 +1764,15 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.delete') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deletePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deletePlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') @@ -1686,12 +1807,15 @@ App::patch('/v1/projects/:projectId/smtp') ->desc('Update SMTP') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmtp') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmtp', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -1776,11 +1900,15 @@ App::post('/v1/projects/:projectId/smtp/tests') ->desc('Create SMTP test') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createSmtpTest') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createSmtpTest', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') ->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender') @@ -1835,12 +1963,15 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Get custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1876,12 +2007,15 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Get custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1928,12 +2062,15 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Update custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1968,12 +2105,15 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Update custom email templates') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2018,12 +2158,15 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Reset custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2061,12 +2204,15 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Reset custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 56fd31e88c..8818de0d54 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -5,6 +5,9 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -28,13 +31,15 @@ App::post('/v1/proxy/rules') ->label('event', 'rules.[ruleId].create') ->label('audits.event', 'rule.create') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'createRule') - ->label('sdk.description', '/docs/references/proxy/create-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'createRule', + description: '/docs/references/proxy/create-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"') ->param('resourceId', '', new UID(), 'ID of resource for the action type. If resourceType is "api", leave empty. If resourceType is "function", provide ID of the function.', true) @@ -150,13 +155,15 @@ App::get('/v1/proxy/rules') ->groups(['api', 'proxy']) ->desc('List rules') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'listRules') - ->label('sdk.description', '/docs/references/proxy/list-rules.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE_LIST) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'listRules', + description: '/docs/references/proxy/list-rules.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -219,13 +226,15 @@ App::get('/v1/proxy/rules/:ruleId') ->groups(['api', 'proxy']) ->desc('Get rule') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'getRule') - ->label('sdk.description', '/docs/references/proxy/get-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'getRule', + description: '/docs/references/proxy/get-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') @@ -251,12 +260,14 @@ App::delete('/v1/proxy/rules/:ruleId') ->label('event', 'rules.[ruleId].delete') ->label('audits.event', 'rules.delete') ->label('audits.resource', 'rule/{request.ruleId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'deleteRule') - ->label('sdk.description', '/docs/references/proxy/delete-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'deleteRule', + description: '/docs/references/proxy/delete-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') @@ -288,12 +299,15 @@ App::patch('/v1/proxy/rules/:ruleId/verification') ->label('event', 'rules.[ruleId].update') ->label('audits.event', 'rule.update') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'updateRuleVerification') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'updateRuleVerification', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('queueForCertificates') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index dda39a0db0..fe4bba7640 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -8,6 +8,10 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; @@ -54,13 +58,15 @@ App::post('/v1/storage/buckets') ->label('event', 'buckets.[bucketId].create') ->label('audits.event', 'bucket.create') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createBucket') - ->label('sdk.description', '/docs/references/storage/create-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createBucket', + description: '/docs/references/storage/create-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Bucket name') ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -150,13 +156,15 @@ App::get('/v1/storage/buckets') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listBuckets') - ->label('sdk.description', '/docs/references/storage/list-buckets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET_LIST) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listBuckets', + description: '/docs/references/storage/list-buckets.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -211,13 +219,15 @@ App::get('/v1/storage/buckets/:bucketId') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucket') - ->label('sdk.description', '/docs/references/storage/get-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucket', + description: '/docs/references/storage/get-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -240,13 +250,15 @@ App::put('/v1/storage/buckets/:bucketId') ->label('event', 'buckets.[bucketId].update') ->label('audits.event', 'bucket.update') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateBucket') - ->label('sdk.description', '/docs/references/storage/update-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateBucket', + description: '/docs/references/storage/update-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->param('name', null, new Text(128), 'Bucket name', false) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -304,12 +316,14 @@ App::delete('/v1/storage/buckets/:bucketId') ->label('audits.event', 'bucket.delete') ->label('event', 'buckets.[bucketId].delete') ->label('audits.resource', 'bucket/{request.bucketId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteBucket') - ->label('sdk.description', '/docs/references/storage/delete-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteBucket', + description: '/docs/references/storage/delete-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -350,15 +364,17 @@ App::post('/v1/storage/buckets/:bucketId/files') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createFile') - ->label('sdk.description', '/docs/references/storage/create-file.md') - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.methodType', 'upload') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createFile', + description: '/docs/references/storage/create-file.md', + methodType: MethodType::UPLOAD, + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + requestType: 'multipart/form-data', + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).', skipValidation: true) @@ -714,13 +730,15 @@ App::get('/v1/storage/buckets/:bucketId/files') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listFiles') - ->label('sdk.description', '/docs/references/storage/list-files.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_LIST) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listFiles', + description: '/docs/references/storage/list-files.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE_LIST, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -806,13 +824,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFile') - ->label('sdk.description', '/docs/references/storage/get-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFile', + description: '/docs/references/storage/get-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -857,13 +877,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->label('cache', true) ->label('cache.resourceType', 'bucket/{request.bucketId}') ->label('cache.resource', 'file/{request.fileId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFilePreview') - ->label('sdk.description', '/docs/references/storage/get-file-preview.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFilePreview', + description: '/docs/references/storage/get-file-preview.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') ->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true) @@ -1027,13 +1050,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileDownload') - ->label('sdk.description', '/docs/references/storage/get-file-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileDownload', + description: '/docs/references/storage/get-file-download.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('request') @@ -1168,13 +1194,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileView') - ->label('sdk.description', '/docs/references/storage/get-file-view.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileView', + description: '/docs/references/storage/get-file-view.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1481,13 +1510,15 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateFile') - ->label('sdk.description', '/docs/references/storage/update-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateFile', + description: '/docs/references/storage/update-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('name', null, new Text(255), 'Name of the file', true) @@ -1590,12 +1621,14 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteFile') - ->label('sdk.description', '/docs/references/storage/delete-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteFile', + description: '/docs/references/storage/delete-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1682,12 +1715,15 @@ App::get('/v1/storage/usage') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_STORAGE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getUsage', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USAGE_STORAGE, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -1762,12 +1798,15 @@ App::get('/v1/storage/:bucketId/usage') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucketUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucketUsage', + description: '/docs/references/storage/get-bucket-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USAGE_BUCKETS, + )) ->param('bucketId', '', new UID(), 'Bucket ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index be055f0935..fc249e9c48 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -11,6 +11,9 @@ use Appwrite\Event\Messaging; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -53,13 +56,15 @@ App::post('/v1/teams') ->label('scope', 'teams.write') ->label('audits.event', 'team.create') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/teams/create-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) + ->label('sdk', new Method( + namespace: 'teams', + name: 'create', + description: '/docs/references/teams/create-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') ->param('roles', ['owner'], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', true) @@ -138,14 +143,16 @@ App::get('/v1/teams') ->desc('List teams') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/teams/list-teams.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM_LIST) - ->label('sdk.offline.model', '/teams') + ->label('sdk', new Method( + namespace: 'teams', + name: 'list', + description: '/docs/references/teams/list-teams.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM_LIST, + responseType: ResponseType::JSON, + offlineModel: '/teams', + )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -202,15 +209,17 @@ App::get('/v1/teams/:teamId') ->desc('Get team') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/teams/get-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'get', + description: '/docs/references/teams/get-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + offlineModel: '/teams', + offlineKey: '{teamId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -229,14 +238,16 @@ App::get('/v1/teams/:teamId/prefs') ->desc('Get team preferences') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/teams/get-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getPrefs', + description: '/docs/references/teams/get-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/prefs', + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -260,15 +271,17 @@ App::put('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/teams/update-team-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateName', + description: '/docs/references/teams/update-team-name.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + offlineModel: '/teams', + offlineKey: '{teamId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('name', null, new Text(128), 'New team name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -304,14 +317,16 @@ App::put('/v1/teams/:teamId/prefs') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/teams/update-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updatePrefs', + description: '/docs/references/teams/update-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/prefs', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -339,12 +354,14 @@ App::delete('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/teams/delete-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'delete', + description: '/docs/references/teams/delete-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('getProjectDB') @@ -390,13 +407,15 @@ App::post('/v1/teams/:teamId/memberships') ->label('audits.event', 'membership.create') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'createMembership') - ->label('sdk.description', '/docs/references/teams/create-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'createMembership', + description: '/docs/references/teams/create-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + )) ->label('abuse-limit', 10) ->param('teamId', '', new UID(), 'Team ID.') ->param('email', '', new Email(), 'Email of the new team member.', true) @@ -715,14 +734,16 @@ App::get('/v1/teams/:teamId/memberships') ->desc('List team memberships') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/teams/list-team-members.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') + ->label('sdk', new Method( + namespace: 'teams', + name: 'listMemberships', + description: '/docs/references/teams/list-team-members.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP_LIST, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/memberships', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -846,15 +867,17 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') ->desc('Get team membership') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getMembership') - ->label('sdk.description', '/docs/references/teams/get-team-member.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') - ->label('sdk.offline.key', '{membershipId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getMembership', + description: '/docs/references/teams/get-team-member.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/memberships', + offlineKey: '{membershipId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') @@ -927,13 +950,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembership') - ->label('sdk.description', '/docs/references/teams/update-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembership', + description: '/docs/references/teams/update-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('roles', [], function (Document $project) { @@ -1010,13 +1035,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembershipStatus') - ->label('sdk.description', '/docs/references/teams/update-team-membership-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembershipStatus', + description: '/docs/references/teams/update-team-membership-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('userId', '', new UID(), 'User ID.') @@ -1147,12 +1174,15 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'deleteMembership') - ->label('sdk.description', '/docs/references/teams/delete-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'deleteMembership', + description: '/docs/references/teams/delete-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') @@ -1210,13 +1240,15 @@ App::get('/v1/teams/:teamId/logs') ->desc('List team logs') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/teams/get-team-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'teams', + name: 'listLogs', + description: '/docs/references/teams/get-team-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 42f7a59f54..2898567280 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -15,6 +15,9 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -192,6 +195,15 @@ App::post('/v1/users') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'create', + description: '/docs/references/users/create-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) ->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -214,13 +226,15 @@ App::post('/v1/users/bcrypt') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createBcryptUser') - ->label('sdk.description', '/docs/references/users/create-bcrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createBcryptUser', + description: '/docs/references/users/create-bcrypt-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Bcrypt.') @@ -243,13 +257,15 @@ App::post('/v1/users/md5') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMD5User') - ->label('sdk.description', '/docs/references/users/create-md5-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMD5User', + description: '/docs/references/users/create-md5-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using MD5.') @@ -272,13 +288,15 @@ App::post('/v1/users/argon2') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createArgon2User') - ->label('sdk.description', '/docs/references/users/create-argon2-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createArgon2User', + description: '/docs/references/users/create-argon2-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Argon2.') @@ -301,13 +319,15 @@ App::post('/v1/users/sha') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSHAUser') - ->label('sdk.description', '/docs/references/users/create-sha-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSHAUser', + description: '/docs/references/users/create-sha-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using SHA.') @@ -337,13 +357,15 @@ App::post('/v1/users/phpass') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createPHPassUser') - ->label('sdk.description', '/docs/references/users/create-phpass-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createPHPassUser', + description: '/docs/references/users/create-phpass-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using PHPass.') @@ -366,13 +388,15 @@ App::post('/v1/users/scrypt') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptUser', + description: '/docs/references/users/create-scrypt-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt.') @@ -408,13 +432,15 @@ App::post('/v1/users/scrypt-modified') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptModifiedUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-modified-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptModifiedUser', + description: '/docs/references/users/create-scrypt-modified-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt Modified.') @@ -441,13 +467,15 @@ App::post('/v1/users/:userId/targets') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createTarget') - ->label('sdk.description', '/docs/references/users/create-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'createTarget', + description: '/docs/references/users/create-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('userId', '', new UID(), 'User ID.') ->param('providerType', '', new WhiteList([MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH]), 'The target provider type. Can be one of the following: `email`, `sms` or `push`.') @@ -527,13 +555,15 @@ App::get('/v1/users') ->desc('List users') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/users/list-users.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'list', + description: '/docs/references/users/list-users.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -587,13 +617,15 @@ App::get('/v1/users/:userId') ->desc('Get user') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/users/get-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'get', + description: '/docs/references/users/get-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -612,13 +644,15 @@ App::get('/v1/users/:userId/prefs') ->desc('Get user preferences') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/users/get-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getPrefs', + description: '/docs/references/users/get-user-prefs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -639,13 +673,15 @@ App::get('/v1/users/:userId/targets/:targetId') ->desc('Get user target') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getTarget') - ->label('sdk.description', '/docs/references/users/get-user-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'getTarget', + description: '/docs/references/users/get-user-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('response') @@ -671,13 +707,15 @@ App::get('/v1/users/:userId/sessions') ->desc('List user sessions') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/users/list-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listSessions', + description: '/docs/references/users/list-user-sessions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -712,13 +750,15 @@ App::get('/v1/users/:userId/memberships') ->desc('List user memberships') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/users/list-user-memberships.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMemberships', + description: '/docs/references/users/list-user-memberships.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -751,13 +791,15 @@ App::get('/v1/users/:userId/logs') ->desc('List user logs') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/users/list-user-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listLogs', + description: '/docs/references/users/list-user-logs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -840,13 +882,15 @@ App::get('/v1/users/:userId/targets') ->desc('List user targets') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/users/list-user-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listTargets', + description: '/docs/references/users/list-user-targets.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -900,13 +944,15 @@ App::get('/v1/users/identities') ->desc('List identities') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/users/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listIdentities', + description: '/docs/references/users/list-identities.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_IDENTITY_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -964,13 +1010,15 @@ App::patch('/v1/users/:userId/status') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/users/update-user-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateStatus', + description: '/docs/references/users/update-user-status.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.') ->inject('response') @@ -999,13 +1047,15 @@ App::put('/v1/users/:userId/labels') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateLabels') - ->label('sdk.description', '/docs/references/users/update-user-labels.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateLabels', + description: '/docs/references/users/update-user-labels.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.') ->inject('response') @@ -1036,13 +1086,15 @@ App::patch('/v1/users/:userId/verification/phone') ->label('scope', 'users.write') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/users/update-user-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhoneVerification', + description: '/docs/references/users/update-user-phone-verification.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('phoneVerification', false, new Boolean(), 'User phone verification status.') ->inject('response') @@ -1072,13 +1124,15 @@ App::patch('/v1/users/:userId/name') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/users/update-user-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateName', + description: '/docs/references/users/update-user-name.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.') ->inject('response') @@ -1109,13 +1163,15 @@ App::patch('/v1/users/:userId/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/users/update-user-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePassword', + description: '/docs/references/users/update-user-password.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->inject('response') @@ -1186,13 +1242,15 @@ App::patch('/v1/users/:userId/email') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/users/update-user-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmail', + description: '/docs/references/users/update-user-email.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('email', '', new Email(allowEmpty: true), 'User email.') ->inject('response') @@ -1280,13 +1338,15 @@ App::patch('/v1/users/:userId/phone') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/users/update-user-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhone', + description: '/docs/references/users/update-user-phone.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('number', '', new Phone(allowEmpty: true), 'User phone number.') ->inject('response') @@ -1364,13 +1424,15 @@ App::patch('/v1/users/:userId/verification') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{request.userId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmailVerification') - ->label('sdk.description', '/docs/references/users/update-user-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmailVerification', + description: '/docs/references/users/update-user-email-verification.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('emailVerification', false, new Boolean(), 'User email verification status.') ->inject('response') @@ -1396,13 +1458,15 @@ App::patch('/v1/users/:userId/prefs') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.prefs') ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/users/update-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePrefs', + description: '/docs/references/users/update-user-prefs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -1431,13 +1495,15 @@ App::patch('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{response.$id}') ->label('event', 'users.[userId].targets.[targetId].update') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateTarget') - ->label('sdk.description', '/docs/references/users/update-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateTarget', + description: '/docs/references/users/update-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)', true) @@ -1530,13 +1596,15 @@ App::patch('/v1/users/:userId/mfa') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfa') - ->label('sdk.description', '/docs/references/users/update-user-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfa', + description: '/docs/references/users/update-user-mfa.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('response') @@ -1564,13 +1632,15 @@ App::get('/v1/users/:userId/mfa/factors') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/users/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMfaFactors', + description: '/docs/references/users/list-mfa-factors.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_FACTORS, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1597,13 +1667,15 @@ App::get('/v1/users/:userId/mfa/recovery-codes') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getMfaRecoveryCodes', + description: '/docs/references/users/get-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1636,13 +1708,15 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMfaRecoveryCodes', + description: '/docs/references/users/create-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1682,13 +1756,15 @@ App::put('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/users/update-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1727,13 +1803,15 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/users/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteMfaAuthenticator', + description: '/docs/references/users/delete-mfa-authenticator.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -1768,13 +1846,15 @@ App::post('/v1/users/:userId/sessions') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{request.userId}') ->label('usage.metric', 'sessions.{scope}.requests.create') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/users/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSession', + description: '/docs/references/users/create-session.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->inject('request') ->inject('response') @@ -1837,13 +1917,15 @@ App::post('/v1/users/:userId/tokens') ->label('scope', 'users.write') ->label('audits.event', 'tokens.create') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createToken') - ->label('sdk.description', '/docs/references/users/create-token.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'users', + name: 'createToken', + description: '/docs/references/users/create-token.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TOKEN, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true) ->param('expire', Auth::TOKEN_EXPIRATION_GENERIC, new Range(60, Auth::TOKEN_EXPIRATION_LOGIN_LONG), 'Token expiration period in seconds. The default expiration is 15 minutes.', true) @@ -1894,12 +1976,15 @@ App::delete('/v1/users/:userId/sessions/:sessionId') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/users/delete-user-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSession', + description: '/docs/references/users/delete-user-session.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') ->inject('response') @@ -1937,12 +2022,15 @@ App::delete('/v1/users/:userId/sessions') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/users/delete-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSessions', + description: '/docs/references/users/delete-user-sessions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1979,12 +2067,15 @@ App::delete('/v1/users/:userId') ->label('scope', 'users.write') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/users/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'delete', + description: '/docs/references/users/delete.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -2021,13 +2112,15 @@ App::delete('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{request.$targetId}') ->label('event', 'users.[userId].targets.[targetId].delete') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteTarget') - ->label('sdk.description', '/docs/references/users/delete-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteTarget', + description: '/docs/references/users/delete-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -2072,12 +2165,15 @@ App::delete('/v1/users/identities/:identityId') ->label('scope', 'users.write') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/users/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteIdentity', + description: '/docs/references/users/delete-identity.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') @@ -2104,13 +2200,15 @@ App::post('/v1/users/:userId/jwts') ->desc('Create user JWT') ->groups(['api', 'users']) ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/users/create-user-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'users', + name: 'createJWT', + description: '/docs/references/users/create-user-jwt.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_JWT, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true) ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) @@ -2154,12 +2252,15 @@ App::get('/v1/users/usage') ->desc('Get users usage stats') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_USERS) + ->label('sdk', new Method( + namespace: 'users', + name: 'getUsage', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_USERS, + responseType: ResponseType::JSON, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index bbb1d9c3f8..526fee27f9 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -4,6 +4,10 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -269,13 +273,17 @@ App::get('/v1/vcs/github/authorize') ->label('scope', 'vcs.read') ->label('sdk.namespace', 'vcs') ->label('error', __DIR__ . '/../../views/general/error.phtml') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createGitHubInstallation') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createGitHubInstallation', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + methodType: MethodType::WEBAUTH, + hide: true, + )) ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients']) ->inject('request') @@ -467,13 +475,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get files and directories of a VCS repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepositoryContents') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VCS_CONTENT_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepositoryContents', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_VCS_CONTENT_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true) @@ -528,13 +538,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr ->desc('Detect runtime settings from source code') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepositoryDetection') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DETECTION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepositoryDetection', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_DETECTION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to Root Directory', true) @@ -600,13 +612,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('List repositories') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositories') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositories', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('gitHub') @@ -695,13 +709,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('Create repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepository', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('name', '', new Text(256), 'Repository name (slug)') ->param('private', '', new Boolean(false), 'Mark repository public or private') @@ -796,13 +812,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepository', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') @@ -845,13 +863,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('List repository branches') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositoryBranches') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BRANCH_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositoryBranches', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_BRANCH_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') @@ -1033,13 +1053,15 @@ App::get('/v1/vcs/installations') ->desc('List installations') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listInstallations') - ->label('sdk.description', '/docs/references/vcs/list-installations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listInstallations', + description: '/docs/references/vcs/list-installations.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_INSTALLATION_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -1099,13 +1121,15 @@ App::get('/v1/vcs/installations/:installationId') ->desc('Get installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getInstallation') - ->label('sdk.description', '/docs/references/vcs/get-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getInstallation', + description: '/docs/references/vcs/get-installation.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_INSTALLATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') @@ -1128,12 +1152,14 @@ App::delete('/v1/vcs/installations/:installationId') ->desc('Delete installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'deleteInstallation') - ->label('sdk.description', '/docs/references/vcs/delete-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'deleteInstallation', + description: '/docs/references/vcs/delete-installation.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_NOCONTENT + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') @@ -1161,12 +1187,14 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor ->desc('Authorize external deployment') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'updateExternalDeployments') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'updateExternalDeployments', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_NOCONTENT + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('repositoryId', '', new Text(256), 'VCS Repository Id') ->param('providerPullRequestId', '', new Text(256), 'GitHub Pull Request Id') diff --git a/app/controllers/mock.php b/app/controllers/mock.php index bc071fc885..fd0a891a94 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -24,7 +24,7 @@ App::get('/v1/mock/tests/general/oauth2') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack ->param('scope', '', new Text(100), 'OAuth2 scope list.') @@ -40,7 +40,7 @@ App::get('/v1/mock/tests/general/oauth2/token') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('client_secret', '', new Text(100), 'OAuth2 scope list.') ->param('grant_type', 'authorization_code', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index a49ad11a10..d0d433410b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -343,11 +343,16 @@ App::init() } /** Do not allow access to disabled services */ - $service = $route->getLabel('sdk.namespace', ''); - if (!empty($service)) { + /** + * @var ?\Appwrite\SDK\Method $method + */ + $method = $route->getLabel('sdk', false); + + if (!empty($method)) { + $namespace = $method->getNamespace(); if ( - array_key_exists($service, $project->getAttribute('services', [])) - && !$project->getAttribute('services', [])[$service] + array_key_exists($namespace, $project->getAttribute('services', [])) + && !$project->getAttribute('services', [])[$namespace] && !(Auth::isPrivilegedUser(Authorization::getRoles()) || Auth::isAppUser(Authorization::getRoles())) ) { throw new Exception(Exception::GENERAL_SERVICE_DISABLED); diff --git a/docs/references/account/create-push-target.md b/docs/references/account/create-push-target.md new file mode 100644 index 0000000000..7535bd1f6b --- /dev/null +++ b/docs/references/account/create-push-target.md @@ -0,0 +1 @@ +Use this endpoint to update an existing push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/account/delete-push-target.md b/docs/references/account/delete-push-target.md new file mode 100644 index 0000000000..6dd2c50d97 --- /dev/null +++ b/docs/references/account/delete-push-target.md @@ -0,0 +1 @@ +Use this endpoint to delete an existing push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/account/update-push-target.md b/docs/references/account/update-push-target.md new file mode 100644 index 0000000000..674d27193c --- /dev/null +++ b/docs/references/account/update-push-target.md @@ -0,0 +1 @@ +Use this endpoint to create a new push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/health/get-version.md b/docs/references/health/get-version.md new file mode 100644 index 0000000000..4247ecdaed --- /dev/null +++ b/docs/references/health/get-version.md @@ -0,0 +1 @@ +Get the version of Appwrite that this instance is currently running. \ No newline at end of file diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 833ea9d032..b8daadefef 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -98,14 +98,17 @@ class Schema foreach ($routes as $route) { /** @var Route $route */ - $namespace = $route->getLabel('sdk.namespace', ''); - $method = $route->getLabel('sdk.method', ''); - $name = $namespace . \ucfirst($method); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); - if (empty($name)) { + if (empty($sdk)) { continue; } + $namespace = $sdk->getNamespace(); + $method = $sdk->getMethodName(); + $name = $namespace . \ucfirst($method); + foreach (Mapper::route($utopia, $route, $complexity) as $field) { switch ($route->getMethod()) { case 'GET': diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index d8f1d7da09..35cc9e28cc 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -86,7 +86,14 @@ class Mapper } } - $names = $route->getLabel('sdk.response.model', 'none'); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); + + if (!$sdk) { + return; + } + + $names = $sdk->getResponseModel() ?? []; $models = \is_array($names) ? \array_map(static fn ($m) => static::$models[$m], $names) : [static::$models[$names]]; diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index f71de98d95..6229899a9a 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Tasks; +use Appwrite\SDK\AuthType; use Appwrite\Specification\Format\OpenAPI3; use Appwrite\Specification\Format\Swagger2; use Appwrite\Specification\Specification; @@ -182,25 +183,31 @@ class Specs extends Action foreach ($appRoutes as $key => $method) { foreach ($method as $route) { - $hide = $route->getLabel('sdk.hide', false); + $sdk = $route->getLabel('sdk', false); + + /** @var \Appwrite\SDK\Method $sdk */ + if (empty($sdk)) { + continue; + } + + $hide = $sdk->isHidden(); if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { continue; } - /** @var \Utopia\Route $route */ - $routeSecurity = $route->getLabel('sdk.auth', []); + $routeSecurity = $sdk->getAuth(); $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_JWT: - case APP_AUTH_TYPE_KEY: + case AuthType::JWT: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -215,15 +222,15 @@ class Specs extends Action continue; } - if ($route->getLabel('sdk.mock', false) && !$mocks) { + if ($route->getLabel('mock', false) && !$mocks) { continue; } - if (!$route->getLabel('sdk.mock', false) && $mocks) { + if (!$route->getLabel('mock', false) && $mocks) { continue; } - if (empty($route->getLabel('sdk.namespace', null))) { + if (empty($sdk->getNamespace())) { continue; } diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php new file mode 100644 index 0000000000..0ae9451b6c --- /dev/null +++ b/src/Appwrite/SDK/Method.php @@ -0,0 +1,222 @@ + $authTypes + * @param string $namespace + * @param MethodType $methodType + * @param string $desc + * @param int $responseCode + * @param string $responseModel + * @param string $offlineKey + * @param string $offlineModel + * + * @throws \Exception + */ + public function __construct( + protected string $namespace, + protected string $name, + protected string $description, + protected array $auth, + protected int $responseCode, + protected string|array $responseModel, + protected ResponseType $responseType = ResponseType::JSON, + protected ?MethodType $methodType = null, + protected ?string $offlineKey = null, + protected ?string $offlineModel = null, + protected ?string $offlineResponseKey = null, + protected bool $deprecated = false, + protected array|bool $hide = false, + protected bool $packaging = false, + protected string $requestType = 'application/json', + protected array $parameters = [], + ) + { + $this->validateMethod($name, $namespace); + $this->validateAuthTypes($auth); + // Disabled for now, will be enabled later + // $this->validateDesc($description); + $this->validateResponseModel($responseModel); + + // No content check + if ($responseCode === 204) { + if ($responseModel !== Response::MODEL_NONE) { + throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + } + } + } + + private function getDebugName(): string + { + return $this->namespace . '.' . $this->name; + } + + private function validateMethod(string $name, string $namespace): void + { + if (\in_array($this->getDebugName(), self::$knownMethods)) { + throw new \Exception('Method ' . $name . ' already exists in namespace ' . $namespace); + } + + self::$knownMethods[] = $this->getDebugName(); + } + + private function validateAuthTypes(array $authTypes): void + { + foreach ($authTypes as $authType) { + if (!($authType instanceof AuthType)) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid auth type"); + } + } + } + + private function validateDesc(string $desc): void + { + if (empty($desc)) { + throw new \Exception("Error with {$this->getDebugName()} method: Description file not set"); + } + + $descPath = \realpath(__DIR__ . '/../../../' . $desc); + + if (!\file_exists($descPath)) { + throw new \Exception("Error with {$this->getDebugName()} method: Description file not found at {$descPath}"); + } + } + + private function validateResponseModel(string|array $responseModel): void + { + $response = new Response(new HttpResponse()); + + if (\is_array($responseModel)) { + foreach ($responseModel as $model) { + try { + $response->getModel($model); + } catch (\Exception $e) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + } + } + + return; + } + + try { + $response->getModel($responseModel); + } catch (\Exception $e) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + } + } + + public function getNamespace(): string + { + return $this->namespace; + } + + public function getMethodName(): string + { + return $this->name; + } + + public function getDescription(): string + { + return $this->description; + } + + public function getAuth(): array + { + return $this->auth; + } + + public function getResponseCode(): int + { + return $this->responseCode; + } + + public function getResponseModel(): string|array + { + return $this->responseModel; + } + + public function getResponseType(): ResponseType + { + return $this->responseType; + } + + public function getMethodType(): ?MethodType + { + return $this->methodType; + } + + public function getOfflineKey(): ?string + { + return $this->offlineKey; + } + + public function getOfflineModel(): ?string + { + return $this->offlineModel; + } + + public function getOfflineResponseKey(): ?string + { + return $this->offlineResponseKey; + } + + public function isDeprecated(): bool + { + return $this->deprecated; + } + + public function isHidden(): bool|array + { + return $this->hide ?? false; + } + + public function isPackaging(): bool + { + return $this->packaging; + } + + public function getRequestType(): string + { + return $this->requestType; + } + + public function getParameters(): array + { + return $this->parameters; + } +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 4dc6e222e0..d18f1e9120 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -120,32 +122,42 @@ class OpenAPI3 extends Format foreach ($this->routes as $route) { $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + $sdk = $route->getLabel('sdk', false); + + if (empty($sdk)) { + continue; + } + + /** + * @var \Appwrite\SDK\Method $sdk + */ + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); if (!empty($method) && is_array($method)) { $method = array_keys($method)[0]; } - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; + $produces = ($sdk->getResponseType())->value; + $model = $sdk->getResponseModel() ?? 'none'; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -156,34 +168,36 @@ class OpenAPI3 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'operationId' => $namespace . ucfirst($method), + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getMethodType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging(), + 'offline-model' => $sdk->getOfflineModel() ?? '', + 'offline-key' => $sdk->getOfflineKey() ?? '', + 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', ], ]; - if (is_array($route->getLabel('sdk.method', ''))) { - $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + if (is_array($sdk->getMethodName() ?? '')) { + $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); } foreach ($this->models as $value) { @@ -198,7 +212,7 @@ class OpenAPI3 extends Format } if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => in_array($produces, [ 'image/*', 'image/jpeg', @@ -219,7 +233,7 @@ class OpenAPI3 extends Format $usedModels[] = $m->getType(); } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $modelDescription, 'content' => [ $produces => [ @@ -232,7 +246,7 @@ class OpenAPI3 extends Format } else { // Response definition using one type $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $model->getName(), 'content' => [ $produces => [ @@ -245,17 +259,18 @@ class OpenAPI3 extends Format } } - if ($route->getLabel('sdk.response.code', 500) === 204) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (($sdk->getResponseCode() ?? 500) === 204) { + $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -306,7 +321,7 @@ class OpenAPI3 extends Format $node['schema']['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getMethodType() === MethodType::UPLOAD) { $node['schema']['x-upload-id'] = true; } $node['schema']['type'] = $validator->getType(); @@ -430,7 +445,7 @@ class OpenAPI3 extends Format $allowed = true; foreach ($this->enumBlacklist as $blacklist) { if ( - $blacklist['namespace'] == $route->getLabel('sdk.namespace', '') + $blacklist['namespace'] == $sdk->getNamespace() && $blacklist['method'] == $method && $blacklist['parameter'] == $name ) { @@ -441,8 +456,8 @@ class OpenAPI3 extends Format if ($allowed) { $node['schema']['enum'] = $validator->getList(); - $node['schema']['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['schema']['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $method, $name); + $node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $method, $name); } if ($validator->getType() === 'integer') { $node['format'] = 'int32'; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d9d2307e07..2595e59f50 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -118,32 +120,40 @@ class Swagger2 extends Format /** @var \Utopia\Route $route */ $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); + + if (empty($sdk)) { + continue; + } + + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); if (!empty($method) && is_array($method)) { $method = array_keys($method)[0]; } - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; + $produces = ($sdk->getResponseType())->value; + $model = $sdk->getResponseModel() ?? 'none'; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -154,31 +164,33 @@ class Swagger2 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), + 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getMethodType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging(), + 'offline-model' => $sdk->getOfflineModel() ?? '', + 'offline-key' => $sdk->getOfflineKey() ?? '', + 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', ], ]; @@ -186,8 +198,8 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (is_array($route->getLabel('sdk.method', ''))) { - $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + if (is_array($sdk->getMethodName() ?? '')) { + $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); } foreach ($this->models as $value) { @@ -202,7 +214,7 @@ class Swagger2 extends Format } if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => in_array($produces, [ 'image/*', 'image/jpeg', @@ -224,7 +236,7 @@ class Swagger2 extends Format foreach ($model as $m) { $usedModels[] = $m->getType(); } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $modelDescription, 'schema' => [ 'x-oneOf' => \array_map(function ($m) { @@ -235,7 +247,7 @@ class Swagger2 extends Format } else { // Response definition using one type $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $model->getName(), 'schema' => [ '$ref' => '#/definitions/' . $model->getType(), @@ -244,17 +256,18 @@ class Swagger2 extends Format } } - if (in_array($route->getLabel('sdk.response.code', 500), [204, 301, 302, 308], true)) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (in_array($sdk->getResponseCode() ?? 500, [204, 301, 302, 308], true)) { + $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -275,7 +288,7 @@ class Swagger2 extends Format $parameters = \array_merge( $route->getParams(), - $route->getLabel('sdk.parameters', []), + $sdk->getParameters() ?? [], ); foreach ($parameters as $name => $param) { // Set params @@ -325,7 +338,7 @@ class Swagger2 extends Format $node['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getMethodType() === MethodType::UPLOAD) { $node['x-upload-id'] = true; } $node['type'] = $validator->getType(); @@ -432,7 +445,7 @@ class Swagger2 extends Format //Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; foreach ($this->enumBlacklist as $blacklist) { - if ($blacklist['namespace'] == $route->getLabel('sdk.namespace', '') && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { + if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { $allowed = false; break; } @@ -440,8 +453,8 @@ class Swagger2 extends Format if ($allowed && $validator->getType() === 'string') { $node['enum'] = $validator->getList(); - $node['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['x-enum-name'] = $this->getEnumName($namespace, $method, $name); + $node['x-enum-keys'] = $this->getEnumKeys($namespace, $method, $name); } if ($validator->getType() === 'integer') { From 67a72edebfa6548ab4bb115dccf26412df62e274 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 16 Dec 2024 15:03:57 +0900 Subject: [PATCH 063/161] Run Linter --- app/controllers/api/account.php | 2 +- app/controllers/api/functions.php | 9 ++++++--- app/controllers/api/messaging.php | 1 - src/Appwrite/SDK/Method.php | 22 ++++++++++++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 1b8c3ac30e..585f1bcecb 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3808,7 +3808,7 @@ App::post('/v1/account/mfa/authenticators/:type') responseModel: Response::MODEL_MFA_TYPE, offlineModel: '/account', offlineKey: 'current' - )) + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 1d485538ee..82ac617e79 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1688,7 +1688,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('scope', 'functions.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'deployment.update') - ->label('audits.resource', 'function/{request.functionId}') + ->label('audits.resource', 'function/{request.functionId}') ->label('sdk', new Method( namespace: 'functions', name: 'updateDeploymentBuild', @@ -2464,7 +2464,8 @@ App::get('/v1/functions/:functionId/variables') ->desc('List variables') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('sdk', + ->label( + 'sdk', new Method( namespace: 'functions', name: 'listVariables', @@ -2496,7 +2497,9 @@ App::get('/v1/functions/:functionId/variables/:variableId') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk', new Method( + ->label( + 'sdk', + new Method( namespace: 'functions', name: 'getVariable', description: '/docs/references/functions/get-variable.md', diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index fbeb38e355..54d8a7577e 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -23,7 +23,6 @@ use Appwrite\Utopia\Database\Validator\Queries\Targets; use Appwrite\Utopia\Database\Validator\Queries\Topics; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; -use Tests\Unit\Auth\AuthTest; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Database\Database; diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 0ae9451b6c..4f0c4f9725 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -5,21 +5,24 @@ namespace Appwrite\SDK; use Appwrite\Utopia\Response; use Swoole\Http\Response as HttpResponse; -enum AuthType: string { +enum AuthType: string +{ case JWT = APP_AUTH_TYPE_JWT; case KEY = APP_AUTH_TYPE_KEY; case SESSION = APP_AUTH_TYPE_SESSION; case ADMIN = APP_AUTH_TYPE_ADMIN; } -enum MethodType: string { +enum MethodType: string +{ case WEBAUTH = 'webAuth'; case LOCATION = 'location'; case GRAPHQL = 'graphql'; case UPLOAD = 'upload'; } -enum ResponseType: string { +enum ResponseType: string +{ case NONE = ''; case JSON = 'application/json'; case IMAGE = 'image/*'; @@ -32,11 +35,11 @@ enum ResponseType: string { class Method { - static array $knownMethods = []; + public static array $knownMethods = []; /** * Initialise a new SDK method - * + * * @param array $authTypes * @param string $namespace * @param MethodType $methodType @@ -45,7 +48,7 @@ class Method * @param string $responseModel * @param string $offlineKey * @param string $offlineModel - * + * * @throws \Exception */ public function __construct( @@ -65,12 +68,11 @@ class Method protected bool $packaging = false, protected string $requestType = 'application/json', protected array $parameters = [], - ) - { + ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); // Disabled for now, will be enabled later - // $this->validateDesc($description); + // $this->validateDesc($description); $this->validateResponseModel($responseModel); // No content check @@ -219,4 +221,4 @@ class Method { return $this->parameters; } -} \ No newline at end of file +} From 2997a112742902e60aa9d6fdad2ad4dfa1e12725 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:27:00 +0900 Subject: [PATCH 064/161] Add SDK Multiplexing --- app/config/specs/open-api3-latest-client.json | 112 +++++++++++++++++ .../specs/open-api3-latest-console.json | 112 +++++++++++++++++ app/config/specs/open-api3-latest-server.json | 114 ++++++++++++++++++ app/config/specs/swagger2-latest-client.json | 111 +++++++++++++++++ app/config/specs/swagger2-latest-console.json | 111 +++++++++++++++++ app/config/specs/swagger2-latest-server.json | 113 +++++++++++++++++ app/controllers/api/databases.php | 58 +++++---- src/Appwrite/SDK/Method.php | 31 ++++- src/Appwrite/SDK/Multiplex.php | 20 +++ .../Specification/Format/OpenAPI3.php | 5 +- 10 files changed, 748 insertions(+), 39 deletions(-) create mode 100644 src/Appwrite/SDK/Multiplex.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 7de634f988..d4dd2885a2 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4524,6 +4524,118 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index b27f65f130..a81b5e9c71 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8093,6 +8093,118 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index a772d5984f..f8672f22c7 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7627,6 +7627,120 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 9c8da35b7c..838296291a 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4710,6 +4710,117 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index aba7d5c4b2..88a1aaab57 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8294,6 +8294,117 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 26d911ca12..5edf0a39c1 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7806,6 +7806,119 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index cf5997619a..e5b8c47fc5 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -9,6 +9,7 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Multiplex; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -2944,37 +2945,32 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->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.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - //TODO: Deal with SDK Multiplexing later - B/S - ->label('sdk.method', [ - 'createDocument' => [ - 'name' => 'Create Document', - 'parameters' => [ - 'documentId', - 'data', - 'permissions', - ], - 'required' => ['documentId', 'data'], - 'response' => Response::MODEL_DOCUMENT, - 'description' => '/docs/references/databases/create-document.md', - ], - 'createDocuments' => [ - 'name' => 'Create Documents', - 'parameters' => [ - 'documents' - ], - 'required' => ['documents'], - 'response' => Response::MODEL_DOCUMENT_LIST, - 'description' => '/docs/references/databases/create-documents.md' - ], - ]) - ->label('sdk.description', '/docs/references/databases/create-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', [Response::MODEL_DOCUMENT, Response::MODEL_DOCUMENT_LIST]) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', + new Method( + namespace: 'databases', + name: 'createDocument', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + multiplex: [ + new Multiplex( + name: 'createDocument', + parameters: ['documentId', 'data', 'permissions'], + required: ['documentId', 'data'], + responseModel: Response::MODEL_DOCUMENT, + ), + new Multiplex( + name: 'createDocuments', + parameters: ['documents'], + required: ['documents'], + responseModel: Response::MODEL_DOCUMENT_LIST, + ), + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 4f0c4f9725..79cf01cefb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -37,17 +37,30 @@ class Method { public static array $knownMethods = []; + /** + * @var array + */ + protected array $multiplexRoutes = []; + /** * Initialise a new SDK method * - * @param array $authTypes * @param string $namespace - * @param MethodType $methodType - * @param string $desc + * @param string $name + * @param string $description + * @param array $auth * @param int $responseCode - * @param string $responseModel - * @param string $offlineKey - * @param string $offlineModel + * @param string|array $responseModel + * @param ResponseType $responseType + * @param MethodType|null $methodType + * @param string|null $offlineKey + * @param string|null $offlineModel + * @param string|null $offlineResponseKey + * @param bool $deprecated + * @param array|bool $hide + * @param bool $packaging + * @param string $requestType + * @param array $parameters * * @throws \Exception */ @@ -68,6 +81,7 @@ class Method protected bool $packaging = false, protected string $requestType = 'application/json', protected array $parameters = [], + protected array $multiplex = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); @@ -221,4 +235,9 @@ class Method { return $this->parameters; } + + public function getMultiplex(): array + { + return $this->multiplex; + } } diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php new file mode 100644 index 0000000000..28754a53ea --- /dev/null +++ b/src/Appwrite/SDK/Multiplex.php @@ -0,0 +1,20 @@ + $parameters + * @param array $required + * @param string $responseModel + */ + function __construct( + private string $name, + private array $parameters, + private array $required, + private string $responseModel + ) + {} +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index d18f1e9120..3cc2ff1698 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Multiplex; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -196,8 +197,8 @@ class OpenAPI3 extends Format ], ]; - if (is_array($sdk->getMethodName() ?? '')) { - $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); + if (!empty($sdk->getMultiplex())) { + $temp['x-appwrite']['multiplex'] = \json_encode($sdk->getMultiplex()); } foreach ($this->models as $value) { From 8ae462c3172e780fbc43202d1728353fbd061614 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:31:26 +0900 Subject: [PATCH 065/161] Fix JSON Encode for multiplex objects --- app/config/specs/open-api3-latest-client.json | 26 ++++++++++++++++++- .../specs/open-api3-latest-console.json | 26 ++++++++++++++++++- app/config/specs/open-api3-latest-server.json | 26 ++++++++++++++++++- app/config/specs/swagger2-latest-client.json | 25 ++++++++++++++++++ app/config/specs/swagger2-latest-console.json | 25 ++++++++++++++++++ app/config/specs/swagger2-latest-server.json | 25 ++++++++++++++++++ src/Appwrite/SDK/Multiplex.php | 14 +++++++++- .../Specification/Format/OpenAPI3.php | 2 +- .../Specification/Format/Swagger2.php | 4 +-- 9 files changed, 166 insertions(+), 7 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index d4dd2885a2..b707348b2b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4564,7 +4564,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a81b5e9c71..a98367ab24 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8133,7 +8133,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index f8672f22c7..c50c1568be 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,7 +7667,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [], "Session": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 838296291a..15524e447b 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4752,6 +4752,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 88a1aaab57..6a2c058134 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8336,6 +8336,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 5edf0a39c1..a02fcb4347 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7848,6 +7848,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [], "Session": [] diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index 28754a53ea..d05c940b75 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -2,7 +2,9 @@ namespace Appwrite\SDK; -class Multiplex +use JsonSerializable; + +class Multiplex implements JsonSerializable { /** * @param string $name @@ -17,4 +19,14 @@ class Multiplex private string $responseModel ) {} + + public function jsonSerialize(): array + { + return [ + 'name' => $this->name, + 'parameters' => $this->parameters, + 'required' => $this->required, + 'responseModel' => $this->responseModel, + ]; + } } \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 3cc2ff1698..450594b253 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -198,7 +198,7 @@ class OpenAPI3 extends Format ]; if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = \json_encode($sdk->getMultiplex()); + $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); } foreach ($this->models as $value) { diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 2595e59f50..5d6bc3a61a 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -198,8 +198,8 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (is_array($sdk->getMethodName() ?? '')) { - $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); + if (!empty($sdk->getMultiplex())) { + $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); } foreach ($this->models as $value) { From 1361dbdec5a758dc6484465a1248b11347227bef Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:33:02 +0900 Subject: [PATCH 066/161] Remove get version API from SDKs --- app/controllers/api/health.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 379afd34fc..aba80a18bc 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -54,15 +54,6 @@ App::get('/v1/health/version') ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') - ->label('sdk', new Method( - namespace: 'health', - name: 'getVersion', - description: '/docs/references/health/get-version.md', - auth: [], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_VERSION, - responseType: ResponseType::JSON - )) ->inject('response') ->action(function (Response $response) { $response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION); From fa053e493a51f920353352a676f18e4527f442ec Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:33:08 +0900 Subject: [PATCH 067/161] Update specs --- app/config/specs/open-api3-latest-client.json | 65 ------------------ .../specs/open-api3-latest-console.json | 65 ------------------ app/config/specs/open-api3-latest-server.json | 65 ------------------ app/config/specs/swagger2-latest-client.json | 67 ------------------- app/config/specs/swagger2-latest-console.json | 67 ------------------- app/config/specs/swagger2-latest-server.json | 67 ------------------- 6 files changed, 396 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index b707348b2b..ff4a9751f6 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -5533,57 +5533,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -9878,20 +9827,6 @@ "countryName" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a98367ab24..2b84f19b25 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -13442,57 +13442,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -37222,20 +37171,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index c50c1568be..e40dc58cd5 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -12291,57 +12291,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -26851,20 +26800,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 15524e447b..d8e02126fe 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -5749,59 +5749,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -10086,20 +10033,6 @@ "countryName" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 6a2c058134..cadb43ec28 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -13700,59 +13700,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -37837,20 +37784,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index a02fcb4347..6b4b7a3e5a 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -12548,59 +12548,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -27408,20 +27355,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", From 64a957859e0e1a9172be17cf3d4c668804299308 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:39:06 +0900 Subject: [PATCH 068/161] Run Linter --- app/controllers/api/databases.php | 6 ++++-- src/Appwrite/SDK/Multiplex.php | 8 ++++---- src/Appwrite/Specification/Format/OpenAPI3.php | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e5b8c47fc5..36b80d1760 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2945,7 +2945,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->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', + ->label( + 'sdk', new Method( namespace: 'databases', name: 'createDocument', @@ -2970,7 +2971,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') responseModel: Response::MODEL_DOCUMENT_LIST, ), ] - )) + ) + ) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index d05c940b75..946838f086 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -12,13 +12,13 @@ class Multiplex implements JsonSerializable * @param array $required * @param string $responseModel */ - function __construct( + public function __construct( private string $name, private array $parameters, private array $required, private string $responseModel - ) - {} + ) { + } public function jsonSerialize(): array { @@ -29,4 +29,4 @@ class Multiplex implements JsonSerializable 'responseModel' => $this->responseModel, ]; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 450594b253..d4e53783a7 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -4,7 +4,6 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; use Appwrite\SDK\MethodType; -use Appwrite\SDK\Multiplex; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; From 624c91816b8fd6b247d73049153ac3ac3e4a1039 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 20 Dec 2024 12:06:09 +0900 Subject: [PATCH 069/161] Begin work on SDKResponse refactor --- app/config/specs/open-api3-latest-client.json | 8 +++-- .../specs/open-api3-latest-console.json | 8 +++-- app/config/specs/open-api3-latest-server.json | 8 +++-- app/config/specs/swagger2-latest-client.json | 8 +++-- app/config/specs/swagger2-latest-console.json | 8 +++-- app/config/specs/swagger2-latest-server.json | 8 +++-- app/controllers/api/health.php | 25 ++++++++++---- src/Appwrite/SDK/Method.php | 6 ++-- src/Appwrite/SDK/Multiplex.php | 28 ++++++++++------ src/Appwrite/SDK/Response.php | 33 +++++++++++++++++++ .../Specification/Format/OpenAPI3.php | 12 ++++++- .../Specification/Format/Swagger2.php | 12 ++++++- 12 files changed, 131 insertions(+), 33 deletions(-) create mode 100644 src/Appwrite/SDK/Response.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index ff4a9751f6..cffba28434 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4576,7 +4576,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -4586,7 +4588,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 2b84f19b25..a9afe4b0e1 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8145,7 +8145,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -8155,7 +8157,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index e40dc58cd5..4960002943 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7679,7 +7679,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -7689,7 +7691,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index d8e02126fe..2bb9cd265c 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4764,7 +4764,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -4774,7 +4776,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index cadb43ec28..bde121a094 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8348,7 +8348,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -8358,7 +8360,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6b4b7a3e5a..f51bba17cd 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7860,7 +7860,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -7870,7 +7872,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index aba80a18bc..46f16d0273 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -5,6 +5,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; @@ -34,8 +35,12 @@ App::get('/v1/health') name: 'get', auth: [AuthType::KEY], description: '/docs/references/health/get.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -68,8 +73,12 @@ App::get('/v1/health/db') namespace: 'health', name: 'getDB', description: '/docs/references/health/get-db.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -124,8 +133,12 @@ App::get('/v1/health/cache') namespace: 'health', name: 'getCache', description: '/docs/references/health/get-cache.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 79cf01cefb..ce4c55c9d8 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -49,8 +49,9 @@ class Method * @param string $name * @param string $description * @param array $auth + * @param array $responses * @param int $responseCode - * @param string|array $responseModel + * @param string|array $responseModel * @param ResponseType $responseType * @param MethodType|null $methodType * @param string|null $offlineKey @@ -69,8 +70,7 @@ class Method protected string $name, protected string $description, protected array $auth, - protected int $responseCode, - protected string|array $responseModel, + protected array $responses, protected ResponseType $responseType = ResponseType::JSON, protected ?MethodType $methodType = null, protected ?string $offlineKey = null, diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index 946838f086..4129169528 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -2,9 +2,7 @@ namespace Appwrite\SDK; -use JsonSerializable; - -class Multiplex implements JsonSerializable +class Multiplex { /** * @param string $name @@ -20,13 +18,23 @@ class Multiplex implements JsonSerializable ) { } - public function jsonSerialize(): array + public function getName(): string { - return [ - 'name' => $this->name, - 'parameters' => $this->parameters, - 'required' => $this->required, - 'responseModel' => $this->responseModel, - ]; + return $this->name; + } + + public function getParameters(): array + { + return $this->parameters; + } + + public function getRequired(): array + { + return $this->required; + } + + public function getResponseModel(): string + { + return $this->responseModel; } } diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php new file mode 100644 index 0000000000..7b521549cb --- /dev/null +++ b/src/Appwrite/SDK/Response.php @@ -0,0 +1,33 @@ +code; + } + + public function getModel(): string + { + return $this->model; + } + + public function getDescription(): string + { + return $this->description; + } +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index d4e53783a7..842c473e78 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -197,7 +197,17 @@ class OpenAPI3 extends Format ]; if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); + $temp['x-appwrite']['multiplex'] = []; + foreach ($sdk->getMultiplex() as $multiplex) { + /** @var \Appwrite\SDK\Multiplex $multiplex */ + + $temp['x-appwrite']['multiplex'][] = [ + 'name' => $multiplex->getName(), + 'parameters' => $multiplex->getParameters(), + 'required' => $multiplex->getRequired(), + 'responses' => ['#/components/schemas/' . $multiplex->getResponseModel()] + ]; + } } foreach ($this->models as $value) { diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 5d6bc3a61a..952064faaf 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -199,7 +199,17 @@ class Swagger2 extends Format } if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); + $temp['x-appwrite']['multiplex'] = []; + foreach ($sdk->getMultiplex() as $multiplex) { + /** @var \Appwrite\SDK\Multiplex $multiplex */ + + $temp['x-appwrite']['multiplex'][] = [ + 'name' => $multiplex->getName(), + 'parameters' => $multiplex->getParameters(), + 'required' => $multiplex->getRequired(), + 'responses' => ["#/definitions/" . $multiplex->getResponseModel()] + ]; + } } foreach ($this->models as $value) { From 6a782ce373baac0637079a0bc592578e5c21cf9e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 30 Dec 2024 11:32:40 +0000 Subject: [PATCH 070/161] Implement SDKResponse class --- app/controllers/api/account.php | 400 ++++++++++++---- app/controllers/api/avatars.php | 71 ++- app/controllers/api/console.php | 17 +- app/controllers/api/databases.php | 442 +++++++++++++----- app/controllers/api/functions.php | 246 +++++++--- app/controllers/api/graphql.php | 29 +- app/controllers/api/health.php | 160 +++++-- app/controllers/api/locale.php | 74 ++- app/controllers/api/messaging.php | 415 ++++++++++------ app/controllers/api/migrations.php | 155 +++--- app/controllers/api/project.php | 55 ++- app/controllers/api/projects.php | 416 +++++++++++------ app/controllers/api/proxy.php | 46 +- app/controllers/api/storage.php | 137 ++++-- app/controllers/api/teams.php | 127 +++-- app/controllers/api/users.php | 389 +++++++++------ app/controllers/api/vcs.php | 97 ++-- composer.lock | 212 +++++---- src/Appwrite/SDK/Method.php | 23 +- src/Appwrite/SDK/Response.php | 14 +- .../Specification/Format/OpenAPI3.php | 113 ++--- .../Specification/Format/Swagger2.php | 104 +++-- 22 files changed, 2503 insertions(+), 1239 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 585f1bcecb..283cf2d8ea 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -24,6 +24,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; @@ -288,8 +289,12 @@ App::post('/v1/account') name: 'create', description: '/docs/references/account/create.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -427,8 +432,12 @@ App::get('/v1/account') name: 'get', description: '/docs/references/account/get.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account', offlineKey: 'current' @@ -454,8 +463,12 @@ App::delete('/v1/account') name: 'delete', description: '/docs/references/account/delete.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->inject('user') @@ -502,8 +515,12 @@ App::get('/v1/account/sessions') name: 'listSessions', description: '/docs/references/account/list-sessions.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account/sessions' )) @@ -548,8 +565,12 @@ App::delete('/v1/account/sessions') name: 'deleteSessions', description: '/docs/references/account/delete-sessions.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 100) @@ -613,8 +634,12 @@ App::get('/v1/account/sessions/:sessionId') name: 'getSession', description: '/docs/references/account/get-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account/sessions', offlineKey: '{sessionId}' @@ -664,8 +689,12 @@ App::delete('/v1/account/sessions/:sessionId') name: 'deleteSession', description: '/docs/references/account/delete-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 100) @@ -748,8 +777,12 @@ App::patch('/v1/account/sessions/:sessionId') name: 'updateSession', description: '/docs/references/account/update-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -828,8 +861,12 @@ App::post('/v1/account/sessions/email') name: 'createEmailPasswordSession', description: '/docs/references/account/create-session-email-password.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -964,8 +1001,12 @@ App::post('/v1/account/sessions/anonymous') name: 'createAnonymousSession', description: '/docs/references/account/create-session-anonymous.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 50) @@ -1103,8 +1144,12 @@ App::post('/v1/account/sessions/token') name: 'createSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -1133,9 +1178,13 @@ App::get('/v1/account/sessions/oauth2/:provider') description: '/docs/references/account/create-session-oauth2.md', methodType: MethodType::WEBAUTH, auth: [], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, - responseModel: Response::MODEL_NONE, hide: [APP_PLATFORM_SERVER], )) ->label('abuse-limit', 50) @@ -1725,9 +1774,13 @@ App::get('/v1/account/tokens/oauth2/:provider') name: 'createOAuth2Token', description: '/docs/references/account/create-token-oauth2.md', auth: [], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, - responseModel: Response::MODEL_NONE, methodType: MethodType::WEBAUTH, )) ->label('abuse-limit', 50) @@ -1801,9 +1854,13 @@ App::post('/v1/account/tokens/magic-url') name: 'createMagicURLToken', description: '/docs/references/account/create-token-magic-url.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -2046,9 +2103,13 @@ App::post('/v1/account/tokens/email') name: 'createEmailToken', description: '/docs/references/account/create-token-email.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -2277,9 +2338,13 @@ App::put('/v1/account/sessions/magic-url') name: 'updateMagicURLSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, deprecated: true, )) ->label('abuse-limit', 10) @@ -2310,9 +2375,13 @@ App::put('/v1/account/sessions/phone') name: 'updatePhoneSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, deprecated: true, )) ->label('abuse-limit', 10) @@ -2344,9 +2413,13 @@ App::post('/v1/account/tokens/phone') name: 'createPhoneToken', description: '/docs/references/account/create-token-phone.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) @@ -2524,9 +2597,13 @@ App::post('/v1/account/jwts') name: 'createJWT', description: '/docs/references/account/create-jwt.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_JWT, )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -2568,9 +2645,13 @@ App::get('/v1/account/prefs') name: 'getPrefs', description: '/docs/references/account/get-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_PREFERENCES, offlineModel: '/account/prefs', offlineKey: 'current', )) @@ -2592,9 +2673,13 @@ App::get('/v1/account/logs') name: 'listLogs', description: '/docs/references/account/list-logs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST, )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2662,9 +2747,13 @@ App::patch('/v1/account/name') name: 'updateName', description: '/docs/references/account/update-name.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2698,9 +2787,13 @@ App::patch('/v1/account/password') name: 'updatePassword', description: '/docs/references/account/update-password.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2769,9 +2862,13 @@ App::patch('/v1/account/email') name: 'updateEmail', description: '/docs/references/account/update-email.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2863,9 +2960,13 @@ App::patch('/v1/account/phone') name: 'updatePhone', description: '/docs/references/account/update-phone.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2946,9 +3047,13 @@ App::patch('/v1/account/prefs') name: 'updatePrefs', description: '/docs/references/account/update-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account/prefs', offlineKey: 'current', )) @@ -2981,9 +3086,13 @@ App::patch('/v1/account/status') name: 'updateStatus', description: '/docs/references/account/update-status.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER )) ->inject('requestTimestamp') ->inject('request') @@ -3027,9 +3136,13 @@ App::post('/v1/account/recovery') name: 'createRecovery', description: '/docs/references/account/create-recovery.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -3209,9 +3322,13 @@ App::put('/v1/account/recovery') name: 'updateRecovery', description: '/docs/references/account/update-recovery.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3295,9 +3412,13 @@ App::post('/v1/account/verification') name: 'createVerification', description: '/docs/references/account/create-email-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -3462,9 +3583,13 @@ App::put('/v1/account/verification') name: 'updateVerification', description: '/docs/references/account/update-email-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3524,9 +3649,13 @@ App::post('/v1/account/verification/phone') name: 'createPhoneVerification', description: '/docs/references/account/create-phone-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) @@ -3653,9 +3782,13 @@ App::put('/v1/account/verification/phone') name: 'updatePhoneVerification', description: '/docs/references/account/update-phone-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') @@ -3714,9 +3847,13 @@ App::patch('/v1/account/mfa') name: 'updateMFA', description: '/docs/references/account/update-mfa.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -3765,9 +3902,13 @@ App::get('/v1/account/mfa/factors') name: 'listMfaFactors', description: '/docs/references/account/list-mfa-factors.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_FACTORS, offlineKey: 'current', offlineModel: '/account' )) @@ -3803,9 +3944,13 @@ App::post('/v1/account/mfa/authenticators/:type') name: 'createMfaAuthenticator', description: '/docs/references/account/create-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_TYPE, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_TYPE, offlineModel: '/account', offlineKey: 'current' )) @@ -3877,9 +4022,13 @@ App::put('/v1/account/mfa/authenticators/:type') name: 'updateMfaAuthenticator', description: '/docs/references/account/update-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current' )) @@ -3944,9 +4093,13 @@ App::post('/v1/account/mfa/recovery-codes') name: 'createMfaRecoveryCodes', description: '/docs/references/account/create-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -3988,9 +4141,13 @@ App::patch('/v1/account/mfa/recovery-codes') name: 'updateMfaRecoveryCodes', description: '/docs/references/account/update-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -4027,9 +4184,13 @@ App::get('/v1/account/mfa/recovery-codes') name: 'getMfaRecoveryCodes', description: '/docs/references/account/get-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -4063,8 +4224,13 @@ App::delete('/v1/account/mfa/authenticators/:type') name: 'deleteMfaAuthenticator', description: '/docs/references/account/delete-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4103,9 +4269,13 @@ App::post('/v1/account/mfa/challenge') name: 'createMfaChallenge', description: '/docs/references/account/create-mfa-challenge.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_CHALLENGE, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_CHALLENGE, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -4293,9 +4463,13 @@ App::put('/v1/account/mfa/challenge') name: 'updateMfaChallenge', description: '/docs/references/account/update-mfa-challenge.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') @@ -4382,9 +4556,13 @@ App::post('/v1/account/targets/push') name: 'createPushTarget', description: '/docs/references/account/create-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ], + responseType: ResponseType::JSON )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4458,9 +4636,13 @@ App::put('/v1/account/targets/:targetId/push') name: 'updatePushTarget', description: '/docs/references/account/update-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ], + responseType: ResponseType::JSON )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4518,8 +4700,13 @@ App::delete('/v1/account/targets/:targetId/push') name: 'deletePushTarget', description: '/docs/references/account/delete-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4563,9 +4750,13 @@ App::get('/v1/account/identities') name: 'listIdentities', description: '/docs/references/account/list-identities.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_IDENTITY_LIST, offlineModel: '/account/identities', )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) @@ -4631,8 +4822,13 @@ App::delete('/v1/account/identities/:identityId') name: 'deleteIdentity', description: '/docs/references/account/delete-identity.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 001ae09b94..e06b8c9ff1 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -4,6 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; @@ -174,9 +175,13 @@ App::get('/v1/avatars/credit-cards/:code') description: '/docs/references/avatars/get-credit-card.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -197,9 +202,13 @@ App::get('/v1/avatars/browsers/:code') description: '/docs/references/avatars/get-browser.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -220,9 +229,13 @@ App::get('/v1/avatars/flags/:code') description: '/docs/references/avatars/get-flag.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -243,9 +256,13 @@ App::get('/v1/avatars/image') description: '/docs/references/avatars/get-image.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -309,9 +326,13 @@ App::get('/v1/avatars/favicon') description: '/docs/references/avatars/get-favicon.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') @@ -455,9 +476,13 @@ App::get('/v1/avatars/qr') description: '/docs/references/avatars/get-qr.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) @@ -499,9 +524,13 @@ App::get('/v1/avatars/initials') description: '/docs/references/avatars/get-initials.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 0ed74b8625..1d5cc085d6 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -3,6 +3,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; @@ -29,8 +30,12 @@ App::get('/v1/console/variables') name: 'variables', description: '/docs/references/console/variables.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CONSOLE_VARIABLES, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONSOLE_VARIABLES, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -70,8 +75,12 @@ App::post('/v1/console/assistant') name: 'chat', description: '/docs/references/assistant/chat.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::TEXT )) ->label('abuse-limit', 15) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 36b80d1760..5c7479ffac 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -10,6 +10,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Multiplex; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -457,8 +458,12 @@ App::post('/v1/databases') name: 'create', description: '/docs/references/databases/create.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -535,8 +540,12 @@ App::get('/v1/databases') name: 'list', description: '/docs/references/databases/list.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) @@ -593,8 +602,12 @@ App::get('/v1/databases/:databaseId') name: 'get', description: '/docs/references/databases/get.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -621,8 +634,12 @@ App::get('/v1/databases/:databaseId/logs') name: 'listLogs', description: '/docs/references/databases/get-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -718,8 +735,12 @@ App::put('/v1/databases/:databaseId') name: 'update', description: '/docs/references/databases/update.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -759,8 +780,13 @@ App::delete('/v1/databases/:databaseId') name: 'delete', description: '/docs/references/databases/delete.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -810,8 +836,12 @@ App::post('/v1/databases/:databaseId/collections') name: 'createCollection', description: '/docs/references/databases/create-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -877,8 +907,12 @@ App::get('/v1/databases/:databaseId/collections') name: 'listCollections', description: '/docs/references/databases/list-collections.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -945,8 +979,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') name: 'getCollection', description: '/docs/references/databases/get-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -982,8 +1020,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') name: 'listCollectionLogs', description: '/docs/references/databases/get-collection-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -1083,8 +1125,12 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') name: 'updateCollection', description: '/docs/references/databases/update-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -1153,8 +1199,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') name: 'deleteCollection', description: '/docs/references/databases/delete-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1211,9 +1262,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string name: 'createStringAttribute', description: '/docs/references/databases/create-string-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_STRING, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_STRING + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1270,9 +1324,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' name: 'createEmailAttribute', description: '/docs/references/databases/create-email-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_EMAIL, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1315,9 +1372,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') name: 'createEnumAttribute', description: '/docs/references/databases/create-attribute-enum.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_ENUM, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1365,9 +1425,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') name: 'createIpAttribute', description: '/docs/references/databases/create-ip-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_IP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1410,9 +1473,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') name: 'createUrlAttribute', description: '/docs/references/databases/create-url-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_URL, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1455,9 +1521,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege name: 'createIntegerAttribute', description: '/docs/references/databases/create-integer-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_INTEGER, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1529,9 +1598,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' name: 'createFloatAttribute', description: '/docs/references/databases/create-float-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_FLOAT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1601,9 +1673,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea name: 'createBooleanAttribute', description: '/docs/references/databases/create-boolean-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1645,9 +1720,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti name: 'createDatetimeAttribute', description: '/docs/references/databases/create-datetime-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_DATETIME, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1692,9 +1770,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati name: 'createRelationshipAttribute', description: '/docs/references/databases/create-relationship-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1820,9 +1901,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') name: 'listAttributes', description: '/docs/references/databases/list-attributes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_LIST + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1903,20 +1987,23 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') name: 'getAttribute', description: '/docs/references/databases/get-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING - ], - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: [ + Response::MODEL_ATTRIBUTE_BOOLEAN, + Response::MODEL_ATTRIBUTE_INTEGER, + Response::MODEL_ATTRIBUTE_FLOAT, + Response::MODEL_ATTRIBUTE_EMAIL, + Response::MODEL_ATTRIBUTE_ENUM, + Response::MODEL_ATTRIBUTE_URL, + Response::MODEL_ATTRIBUTE_IP, + Response::MODEL_ATTRIBUTE_DATETIME, + Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_STRING + ] + ), + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1984,8 +2071,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin name: 'updateStringAttribute', description: '/docs/references/databases/update-string-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_STRING, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_STRING, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2031,8 +2122,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email name: 'updateEmailAttribute', description: '/docs/references/databases/update-email-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2076,8 +2171,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ name: 'updateEnumAttribute', description: '/docs/references/databases/update-enum-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2123,8 +2222,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k name: 'updateIpAttribute', description: '/docs/references/databases/update-ip-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_IP, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2168,8 +2271,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: name: 'updateUrlAttribute', description: '/docs/references/databases/update-url-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_URL, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2213,8 +2320,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ name: 'updateIntegerAttribute', description: '/docs/references/databases/update-integer-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2268,8 +2379,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float name: 'updateFloatAttribute', description: '/docs/references/databases/update-float-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2323,8 +2438,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole name: 'updateBooleanAttribute', description: '/docs/references/databases/update-boolean-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2367,8 +2486,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet name: 'updateDatetimeAttribute', description: '/docs/references/databases/update-datetime-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2411,8 +2534,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ name: 'updateRelationshipAttribute', description: '/docs/references/databases/update-relationship-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2472,8 +2599,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key name: 'deleteAttribute', description: '/docs/references/databases/delete-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2588,8 +2720,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') name: 'createIndex', description: '/docs/references/databases/create-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_INDEX, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_INDEX, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2758,8 +2894,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') name: 'listIndexes', description: '/docs/references/databases/list-indexes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_INDEX_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2836,8 +2976,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') name: 'getIndex', description: '/docs/references/databases/get-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_INDEX, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2881,8 +3025,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') name: 'deleteIndex', description: '/docs/references/databases/delete-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2952,8 +3101,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'createDocument', description: '/docs/references/databases/create-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', @@ -3260,8 +3413,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'listDocuments', description: '/docs/references/databases/list-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', )) @@ -3417,8 +3574,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen name: 'getDocument', description: '/docs/references/databases/get-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -3512,8 +3673,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen name: 'listDocumentLogs', description: '/docs/references/databases/get-document-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -3625,8 +3790,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum name: 'updateDocument', description: '/docs/references/databases/update-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -3864,8 +4033,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'updateDocuments', description: '/docs/references/databases/update-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', )) @@ -4003,8 +4176,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu name: 'deleteDocument', description: '/docs/references/databases/delete-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) @@ -4123,8 +4301,12 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'deleteDocuments', description: '/docs/references/databases/delete-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -4229,9 +4411,13 @@ App::get('/v1/databases/usage') name: 'getUsage', description: '/docs/references/databases/get-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_DATABASES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASES, + ) + ], + responseType: ResponseType::JSON )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4314,8 +4500,12 @@ App::get('/v1/databases/:databaseId/usage') name: 'getDatabaseUsage', description: '/docs/references/databases/get-database-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASE, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -4405,8 +4595,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') name: 'getCollectionUsage', description: '/docs/references/databases/get-collection-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_COLLECTION, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 82ac617e79..8d79ecd40e 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -17,6 +17,7 @@ use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; @@ -150,9 +151,12 @@ App::post('/v1/functions') name: 'create', description: '/docs/references/functions/create-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FUNCTION, + ) + ], )) ->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') @@ -413,9 +417,12 @@ App::get('/v1/functions') name: 'list', description: '/docs/references/functions/list-functions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION_LIST, + ) + ] )) ->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -476,9 +483,12 @@ App::get('/v1/functions/runtimes') name: 'listRuntimes', description: '/docs/references/functions/list-runtimes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_RUNTIME_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RUNTIME_LIST, + ) + ] )) ->inject('response') ->action(function (Response $response) { @@ -512,9 +522,12 @@ App::get('/v1/functions/specifications') name: 'listSpecifications', description: '/docs/references/functions/list-specifications.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SPECIFICATION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SPECIFICATION_LIST, + ) + ] )) ->inject('response') ->inject('plan') @@ -551,9 +564,12 @@ App::get('/v1/functions/:functionId') name: 'get', description: '/docs/references/functions/get-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -578,9 +594,12 @@ App::get('/v1/functions/:functionId/usage') name: 'getFunctionUsage', description: '/docs/references/functions/get-function-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) @@ -686,9 +705,12 @@ App::get('/v1/functions/usage') name: 'getUsage', description: '/docs/references/functions/get-functions-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_FUNCTIONS, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTIONS, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') @@ -792,9 +814,12 @@ App::put('/v1/functions/:functionId') name: 'update', description: '/docs/references/functions/update-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') @@ -994,8 +1019,12 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') name: 'getDeploymentDownload', description: '/docs/references/functions/get-deployment-download.md', auth: [AuthType::KEY, AuthType::JWT], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::ANY, methodType: MethodType::LOCATION )) @@ -1086,9 +1115,12 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') name: 'updateDeployment', description: '/docs/references/functions/update-function-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1151,8 +1183,12 @@ App::delete('/v1/functions/:functionId') name: 'delete', description: '/docs/references/functions/delete-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1201,10 +1237,13 @@ App::post('/v1/functions/:functionId/deployments') name: 'createDeployment', description: '/docs/references/functions/create-deployment.md', auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_DEPLOYMENT, + ) + ], requestType: 'multipart/form-data', - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_DEPLOYMENT, - responseType: ResponseType::JSON, methodType: MethodType::UPLOAD, packaging: true, )) @@ -1420,9 +1459,12 @@ App::get('/v1/functions/:functionId/deployments') name: 'listDeployments', description: '/docs/references/functions/list-deployments.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DEPLOYMENT_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT_LIST, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) @@ -1506,9 +1548,12 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') name: 'getDeployment', description: '/docs/references/functions/get-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DEPLOYMENT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1555,8 +1600,12 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') name: 'deleteDeployment', description: '/docs/references/functions/delete-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1623,8 +1672,12 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build') name: 'createBuild', description: '/docs/references/functions/create-deployment-build.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1694,9 +1747,12 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') name: 'updateDeploymentBuild', description: '/docs/references/functions/update-deployment-build.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUILD, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUILD, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1786,9 +1842,13 @@ App::post('/v1/functions/:functionId/executions') name: 'createExecution', description: '/docs/references/functions/create-execution.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], responseType: ResponseType::MULTIPART, - responseModel: Response::MODEL_EXECUTION, requestType: 'application/json', )) ->param('functionId', '', new UID(), 'Function ID.') @@ -2190,9 +2250,12 @@ App::get('/v1/functions/:functionId/executions') name: 'listExecutions', description: '/docs/references/functions/list-executions.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_EXECUTION_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION_LIST, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) @@ -2280,9 +2343,12 @@ App::get('/v1/functions/:functionId/executions/:executionId') name: 'getExecution', description: '/docs/references/functions/get-execution.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_EXECUTION + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2333,8 +2399,12 @@ App::delete('/v1/functions/:functionId/executions/:executionId') name: 'deleteExecution', description: '/docs/references/functions/delete-execution.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2405,9 +2475,12 @@ App::post('/v1/functions/:functionId/variables') name: 'createVariable', description: '/docs/references/functions/create-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) @@ -2471,9 +2544,12 @@ App::get('/v1/functions/:functionId/variables') name: 'listVariables', description: '/docs/references/functions/list-variables.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ], ) ) ->param('functionId', '', new UID(), 'Function unique ID.', false) @@ -2504,9 +2580,12 @@ App::get('/v1/functions/:functionId/variables/:variableId') name: 'getVariable', description: '/docs/references/functions/get-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ], ) ) ->param('functionId', '', new UID(), 'Function unique ID.', false) @@ -2549,9 +2628,12 @@ App::put('/v1/functions/:functionId/variables/:variableId') name: 'updateVariable', description: '/docs/references/functions/update-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) @@ -2613,8 +2695,12 @@ App::delete('/v1/functions/:functionId/variables/:variableId') name: 'deleteVariable', description: '/docs/references/functions/delete-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) @@ -2662,9 +2748,12 @@ App::get('/v1/functions/templates') name: 'listTemplates', description: '/docs/references/functions/list-templates.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TEMPLATE_FUNCTION_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION_LIST, + ) + ] )) ->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true) ->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true) @@ -2702,9 +2791,12 @@ App::get('/v1/functions/templates/:templateId') name: 'getTemplate', description: '/docs/references/functions/get-template.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TEMPLATE_FUNCTION + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION, + ) + ] )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 6d34a8c70a..1f4e4e334a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -8,7 +8,7 @@ use Appwrite\GraphQL\Schema; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use GraphQL\Error\DebugFlag; @@ -48,9 +48,12 @@ App::get('/v1/graphql') auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], hide: true, description: '/docs/references/graphql/get.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ] )) ->label('abuse-limit', 60) ->label('abuse-time', 60) @@ -90,9 +93,12 @@ App::post('/v1/graphql/mutation') name: 'mutation', auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], description: '/docs/references/graphql/post.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], methodType: MethodType::GRAPHQL, parameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], @@ -137,9 +143,12 @@ App::post('/v1/graphql') name: 'query', auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], description: '/docs/references/graphql/post.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], methodType: MethodType::GRAPHQL, parameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 46f16d0273..baa737ce1e 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -197,8 +197,12 @@ App::get('/v1/health/queue') namespace: 'health', name: 'getQueue', description: '/docs/references/health/get-queue.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -256,8 +260,12 @@ App::get('/v1/health/pubsub') namespace: 'health', name: 'getPubSub', description: '/docs/references/health/get-pubsub.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -316,8 +324,12 @@ App::get('/v1/health/time') namespace: 'health', name: 'getTime', description: '/docs/references/health/get-time.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_TIME, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_TIME, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -375,8 +387,12 @@ App::get('/v1/health/queue/webhooks') namespace: 'health', name: 'getQueueWebhooks', description: '/docs/references/health/get-queue-webhooks.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -404,8 +420,12 @@ App::get('/v1/health/queue/logs') namespace: 'health', name: 'getQueueLogs', description: '/docs/references/health/get-queue-logs.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -433,8 +453,12 @@ App::get('/v1/health/certificate') namespace: 'health', name: 'getCertificate', description: '/docs/references/health/get-certificate.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_CERTIFICATE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_CERTIFICATE, + ) + ], responseType: ResponseType::JSON )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') @@ -485,8 +509,12 @@ App::get('/v1/health/queue/certificates') namespace: 'health', name: 'getQueueCertificates', description: '/docs/references/health/get-queue-certificates.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -514,8 +542,12 @@ App::get('/v1/health/queue/builds') namespace: 'health', name: 'getQueueBuilds', description: '/docs/references/health/get-queue-builds.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -543,8 +575,12 @@ App::get('/v1/health/queue/databases') namespace: 'health', name: 'getQueueDatabases', description: '/docs/references/health/get-queue-databases.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) @@ -573,8 +609,12 @@ App::get('/v1/health/queue/deletes') namespace: 'health', name: 'getQueueDeletes', description: '/docs/references/health/get-queue-deletes.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -602,8 +642,12 @@ App::get('/v1/health/queue/mails') namespace: 'health', name: 'getQueueMails', description: '/docs/references/health/get-queue-mails.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -631,8 +675,12 @@ App::get('/v1/health/queue/messaging') namespace: 'health', name: 'getQueueMessaging', description: '/docs/references/health/get-queue-messaging.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -660,8 +708,12 @@ App::get('/v1/health/queue/migrations') namespace: 'health', name: 'getQueueMigrations', description: '/docs/references/health/get-queue-migrations.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -689,8 +741,12 @@ App::get('/v1/health/queue/functions') namespace: 'health', name: 'getQueueFunctions', description: '/docs/references/health/get-queue-functions.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -718,8 +774,12 @@ App::get('/v1/health/queue/usage') namespace: 'health', name: 'getQueueUsage', description: '/docs/references/health/get-queue-usage.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -747,8 +807,12 @@ App::get('/v1/health/queue/usage-dump') namespace: 'health', name: 'getQueueUsageDump', description: '/docs/references/health/get-queue-usage-dump.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -776,8 +840,12 @@ App::get('/v1/health/storage/local') namespace: 'health', name: 'getStorageLocal', description: '/docs/references/health/get-storage-local.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -821,8 +889,12 @@ App::get('/v1/health/storage') namespace: 'health', name: 'getStorage', description: '/docs/references/health/get-storage.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -864,8 +936,12 @@ App::get('/v1/health/anti-virus') namespace: 'health', name: 'getAntivirus', description: '/docs/references/health/get-storage-anti-virus.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_ANTIVIRUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_ANTIVIRUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -905,8 +981,12 @@ App::get('/v1/health/queue/failed/:name') namespace: 'health', name: 'getFailedJobs', description: '/docs/references/health/get-failed-queue-jobs.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('name', '', new WhiteList([ diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index c918d666a0..28defca386 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -2,7 +2,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; @@ -20,9 +20,12 @@ App::get('/v1/locale') name: 'get', description: '/docs/references/locale/get-locale.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOCALE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE, + ) + ], offlineKey: 'current', offlineModel: '/localed', )) @@ -82,9 +85,12 @@ App::get('/v1/locale/codes') name: 'listCodes', description: '/docs/references/locale/list-locale-codes.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOCALE_CODE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE_CODE_LIST, + ) + ], offlineKey: 'current', offlineModel: '/locale/localeCode', )) @@ -106,9 +112,12 @@ App::get('/v1/locale/countries') name: 'listCountries', description: '/docs/references/locale/list-countries.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COUNTRY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ], offlineModel: '/locale/countries', offlineResponseKey: 'code' )) @@ -141,9 +150,12 @@ App::get('/v1/locale/countries/eu') name: 'listCountriesEU', description: '/docs/references/locale/list-countries-eu.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COUNTRY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ], offlineModel: '/locale/countries/eu', offlineResponseKey: 'code' )) @@ -178,9 +190,12 @@ App::get('/v1/locale/countries/phones') name: 'listCountriesPhones', description: '/docs/references/locale/list-countries-phones.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PHONE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PHONE_LIST, + ) + ], offlineModel: '/locale/countries/phones', offlineResponseKey: 'countryCode' )) @@ -214,9 +229,12 @@ App::get('/v1/locale/continents') name: 'listContinents', description: '/docs/references/locale/list-continents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CONTINENT_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONTINENT_LIST, + ) + ], offlineModel: '/locale/continents', offlineResponseKey: 'code' )) @@ -248,9 +266,12 @@ App::get('/v1/locale/currencies') name: 'listCurrencies', description: '/docs/references/locale/list-currencies.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CURRENCY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CURRENCY_LIST, + ) + ], offlineModel: '/locale/currencies', offlineResponseKey: 'code' )) @@ -273,9 +294,12 @@ App::get('/v1/locale/languages') name: 'listLanguages', description: '/docs/references/locale/list-languages.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LANGUAGE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LANGUAGE_LIST, + ) + ], offlineModel: '/locale/languages', offlineResponseKey: 'code' )) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 54d8a7577e..44e77c953d 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -13,7 +13,7 @@ use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -65,9 +65,12 @@ App::post('/v1/messaging/providers/mailgun') name: 'createMailgunProvider', description: '/docs/references/messaging/create-mailgun-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -155,9 +158,12 @@ App::post('/v1/messaging/providers/sendgrid') name: 'createSendgridProvider', description: '/docs/references/messaging/create-sendgrid-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -233,9 +239,12 @@ App::post('/v1/messaging/providers/smtp') name: 'createSmtpProvider', description: '/docs/references/messaging/create-smtp-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -324,9 +333,12 @@ App::post('/v1/messaging/providers/msg91') name: 'createMsg91Provider', description: '/docs/references/messaging/create-msg91-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -403,9 +415,12 @@ App::post('/v1/messaging/providers/telesign') name: 'createTelesignProvider', description: '/docs/references/messaging/create-telesign-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -483,9 +498,12 @@ App::post('/v1/messaging/providers/textmagic') name: 'createTextmagicProvider', description: '/docs/references/messaging/create-textmagic-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -563,9 +581,12 @@ App::post('/v1/messaging/providers/twilio') name: 'createTwilioProvider', description: '/docs/references/messaging/create-twilio-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -643,9 +664,12 @@ App::post('/v1/messaging/providers/vonage') name: 'createVonageProvider', description: '/docs/references/messaging/create-vonage-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -723,9 +747,12 @@ App::post('/v1/messaging/providers/fcm') name: 'createFcmProvider', description: '/docs/references/messaging/create-fcm-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -789,9 +816,12 @@ App::post('/v1/messaging/providers/apns') name: 'createApnsProvider', description: '/docs/references/messaging/create-apns-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -875,9 +905,12 @@ App::get('/v1/messaging/providers') name: 'listProviders', description: '/docs/references/messaging/list-providers.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_LIST, + ) + ] )) ->param('queries', [], new Providers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -934,9 +967,12 @@ App::get('/v1/messaging/providers/:providerId/logs') name: 'listProviderLogs', description: '/docs/references/messaging/list-provider-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -1025,9 +1061,12 @@ App::get('/v1/messaging/providers/:providerId') name: 'getProvider', description: '/docs/references/messaging/get-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('dbForProject') @@ -1055,9 +1094,12 @@ App::patch('/v1/messaging/providers/mailgun/:providerId') name: 'updateMailgunProvider', description: '/docs/references/messaging/update-mailgun-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1164,9 +1206,12 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId') name: 'updateSendgridProvider', description: '/docs/references/messaging/update-sendgrid-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1258,9 +1303,12 @@ App::patch('/v1/messaging/providers/smtp/:providerId') name: 'updateSmtpProvider', description: '/docs/references/messaging/update-smtp-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1383,9 +1431,12 @@ App::patch('/v1/messaging/providers/msg91/:providerId') name: 'updateMsg91Provider', description: '/docs/references/messaging/update-msg91-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1466,9 +1517,12 @@ App::patch('/v1/messaging/providers/telesign/:providerId') name: 'updateTelesignProvider', description: '/docs/references/messaging/update-telesign-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1551,9 +1605,12 @@ App::patch('/v1/messaging/providers/textmagic/:providerId') name: 'updateTextmagicProvider', description: '/docs/references/messaging/update-textmagic-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1636,9 +1693,12 @@ App::patch('/v1/messaging/providers/twilio/:providerId') name: 'updateTwilioProvider', description: '/docs/references/messaging/update-twilio-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1721,9 +1781,12 @@ App::patch('/v1/messaging/providers/vonage/:providerId') name: 'updateVonageProvider', description: '/docs/references/messaging/update-vonage-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1806,9 +1869,12 @@ App::patch('/v1/messaging/providers/fcm/:providerId') name: 'updateFcmProvider', description: '/docs/references/messaging/update-fcm-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1878,9 +1944,12 @@ App::patch('/v1/messaging/providers/apns/:providerId') name: 'updateApnsProvider', description: '/docs/references/messaging/update-apns-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1976,9 +2045,12 @@ App::delete('/v1/messaging/providers/:providerId') name: 'deleteProvider', description: '/docs/references/messaging/delete-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2014,9 +2086,12 @@ App::post('/v1/messaging/topics') name: 'createTopic', description: '/docs/references/messaging/create-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new CustomId(), 'Topic ID. Choose a custom Topic ID or a new Topic ID.') ->param('name', '', new Text(128), 'Topic Name.') @@ -2057,9 +2132,12 @@ App::get('/v1/messaging/topics') name: 'listTopics', description: '/docs/references/messaging/list-topics.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC_LIST, + ) + ] )) ->param('queries', [], new Topics(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Topics::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2116,9 +2194,12 @@ App::get('/v1/messaging/topics/:topicId/logs') name: 'listTopicLogs', description: '/docs/references/messaging/list-topic-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -2208,9 +2289,12 @@ App::get('/v1/messaging/topics/:topicId') name: 'getTopic', description: '/docs/references/messaging/get-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('dbForProject') @@ -2239,9 +2323,12 @@ App::patch('/v1/messaging/topics/:topicId') name: 'updateTopic', description: '/docs/references/messaging/update-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('name', null, new Text(128), 'Topic Name.', true) @@ -2286,9 +2373,12 @@ App::delete('/v1/messaging/topics/:topicId') name: 'deleteTopic', description: '/docs/references/messaging/delete-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2329,9 +2419,12 @@ App::post('/v1/messaging/topics/:topicId/subscribers') name: 'createSubscriber', description: '/docs/references/messaging/create-subscriber.md', auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SUBSCRIBER, + ) + ] )) ->param('subscriberId', '', new CustomId(), 'Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.') ->param('topicId', '', new UID(), 'Topic ID. The topic ID to subscribe to.') @@ -2425,9 +2518,12 @@ App::get('/v1/messaging/topics/:topicId/subscribers') name: 'listSubscribers', description: '/docs/references/messaging/list-subscribers.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER_LIST, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('queries', [], new Subscribers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) @@ -2507,9 +2603,12 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') name: 'listSubscriberLogs', description: '/docs/references/messaging/list-subscriber-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -2599,9 +2698,12 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') name: 'getSubscriber', description: '/docs/references/messaging/get-subscriber.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -2644,9 +2746,12 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') name: 'deleteSubscriber', description: '/docs/references/messaging/delete-subscriber.md', auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -2706,9 +2811,12 @@ App::post('/v1/messaging/messages/email') name: 'createEmail', description: '/docs/references/messaging/create-email.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') @@ -2861,9 +2969,12 @@ App::post('/v1/messaging/messages/sms') name: 'createSms', description: '/docs/references/messaging/create-sms.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') @@ -2980,9 +3091,12 @@ App::post('/v1/messaging/messages/push') name: 'createPush', description: '/docs/references/messaging/create-push.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('title', '', new Text(256), 'Title for push notification.') @@ -3156,9 +3270,12 @@ App::get('/v1/messaging/messages') name: 'listMessages', description: '/docs/references/messaging/list-messages.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE_LIST, + ) + ], )) ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -3215,9 +3332,12 @@ App::get('/v1/messaging/messages/:messageId/logs') name: 'listMessageLogs', description: '/docs/references/messaging/list-message-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -3307,9 +3427,12 @@ App::get('/v1/messaging/messages/:messageId/targets') name: 'listTargets', description: '/docs/references/messaging/list-message-targets.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ], )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) @@ -3380,9 +3503,12 @@ App::get('/v1/messaging/messages/:messageId') name: 'getMessage', description: '/docs/references/messaging/get-message.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') @@ -3410,9 +3536,12 @@ App::patch('/v1/messaging/messages/email/:messageId') name: 'updateEmail', description: '/docs/references/messaging/update-email.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -3613,9 +3742,12 @@ App::patch('/v1/messaging/messages/sms/:messageId') name: 'updateSms', description: '/docs/references/messaging/update-sms.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -3771,9 +3903,12 @@ App::patch('/v1/messaging/messages/push/:messageId') name: 'updatePush', description: '/docs/references/messaging/update-push.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -4012,8 +4147,12 @@ App::delete('/v1/messaging/messages/:messageId') name: 'delete', description: '/docs/references/messaging/delete-message.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 1fb18e1e15..e41c23da69 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -9,7 +9,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -47,9 +47,12 @@ App::post('/v1/migrations/appwrite') name: 'createAppwriteMigration', description: '/docs/references/migrations/migration-appwrite.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") @@ -104,9 +107,12 @@ App::post('/v1/migrations/firebase/oauth') name: 'createFirebaseOAuthMigration', description: '/docs/references/migrations/migration-firebase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project') @@ -209,9 +215,12 @@ App::post('/v1/migrations/firebase') name: 'createFirebaseMigration', description: '/docs/references/migrations/migration-firebase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') @@ -272,9 +281,12 @@ App::post('/v1/migrations/supabase') name: 'createSupabaseMigration', description: '/docs/references/migrations/migration-supabase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') @@ -335,9 +347,12 @@ App::post('/v1/migrations/nhost') name: 'createNHostMigration', description: '/docs/references/migrations/migration-nhost.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') @@ -398,9 +413,12 @@ App::get('/v1/migrations') name: 'list', description: '/docs/references/migrations/list-migrations.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_LIST, + ) + ] )) ->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -459,9 +477,12 @@ App::get('/v1/migrations/:migrationId') name: 'get', description: '/docs/references/migrations/get-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') @@ -485,9 +506,12 @@ App::get('/v1/migrations/appwrite/report') name: 'getAppwriteReport', description: '/docs/references/migrations/migration-appwrite-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") @@ -529,9 +553,12 @@ App::get('/v1/migrations/firebase/report') name: 'getFirebaseReport', description: '/docs/references/migrations/migration-firebase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') @@ -578,9 +605,12 @@ App::get('/v1/migrations/firebase/report/oauth') name: 'getFirebaseReportOAuth', description: '/docs/references/migrations/migration-firebase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID') @@ -671,9 +701,12 @@ App::get('/v1/migrations/firebase/connect') name: 'createFirebaseAuth', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::HTML, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], hide: true, methodType: MethodType::WEBAUTH )) @@ -828,9 +861,12 @@ App::get('/v1/migrations/firebase/projects') name: 'listFirebaseProjects', description: '/docs/references/migrations/migration-firebase-projects.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, + ) + ] )) ->inject('user') ->inject('response') @@ -919,9 +955,12 @@ App::get('/v1/migrations/firebase/deauthorize') name: 'deleteFirebaseAuth', description: '/docs/references/migrations/migration-firebase-deauthorize.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ] )) ->inject('user') ->inject('response') @@ -950,9 +989,12 @@ App::get('/v1/migrations/supabase/report') name: 'getSupabaseReport', description: '/docs/references/migrations/migration-supabase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.') @@ -995,9 +1037,12 @@ App::get('/v1/migrations/nhost/report') name: 'getNHostReport', description: '/docs/references/migrations/migration-nhost-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain.') @@ -1043,9 +1088,12 @@ App::patch('/v1/migrations/:migrationId') name: 'retry', description: '/docs/references/migrations/retry-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') @@ -1090,9 +1138,12 @@ App::delete('/v1/migrations/:migrationId') name: 'delete', description: '/docs/references/migrations/delete-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 1685a04152..3356497a13 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -3,7 +3,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -28,9 +28,12 @@ App::get('/v1/project/usage') name: 'getUsage', description: '/docs/references/project/get-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_PROJECT, + ) + ] )) ->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage') ->param('endDate', '', new DateTimeValidator(), 'End date for the usage') @@ -324,9 +327,12 @@ App::post('/v1/project/variables') name: 'createVariable', description: '/docs/references/project/create-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) @@ -380,9 +386,12 @@ App::get('/v1/project/variables') name: 'listVariables', description: '/docs/references/project/list-variables.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ] )) ->inject('response') ->inject('dbForProject') @@ -407,9 +416,12 @@ App::get('/v1/project/variables/:variableId') name: 'getVariable', description: '/docs/references/project/get-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -433,9 +445,12 @@ App::put('/v1/project/variables/:variableId') name: 'updateVariable', description: '/docs/references/project/update-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) @@ -481,8 +496,12 @@ App::delete('/v1/project/variables/:variableId') name: 'deleteVariable', description: '/docs/references/project/delete-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 901b94f579..c1251ecd8b 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -12,7 +12,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -70,9 +70,12 @@ App::post('/v1/projects') name: 'create', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') @@ -263,9 +266,12 @@ App::get('/v1/projects') name: 'list', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT_LIST, + ) + ] )) ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -325,9 +331,12 @@ App::get('/v1/projects/:projectId') name: 'get', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -352,9 +361,12 @@ App::patch('/v1/projects/:projectId') name: 'update', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') @@ -402,9 +414,12 @@ App::patch('/v1/projects/:projectId/team') name: 'updateTeam', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.') @@ -473,9 +488,12 @@ App::patch('/v1/projects/:projectId/service') name: 'updateServiceStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') @@ -507,9 +525,12 @@ App::patch('/v1/projects/:projectId/service/all') name: 'updateServiceStatusAll', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'Service status.') @@ -544,9 +565,12 @@ App::patch('/v1/projects/:projectId/api') name: 'updateApiStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') @@ -578,9 +602,12 @@ App::patch('/v1/projects/:projectId/api/all') name: 'updateApiStatusAll', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') @@ -615,9 +642,12 @@ App::patch('/v1/projects/:projectId/oauth2') name: 'updateOAuth2', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name') @@ -662,9 +692,12 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') name: 'updateSessionAlerts', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.') @@ -696,9 +729,12 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy') name: 'updateMembershipsPrivacy', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.') @@ -734,9 +770,12 @@ App::patch('/v1/projects/:projectId/auth/limit') name: 'updateAuthLimit', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') @@ -768,9 +807,12 @@ App::patch('/v1/projects/:projectId/auth/duration') name: 'updateAuthDuration', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.') @@ -802,9 +844,12 @@ App::patch('/v1/projects/:projectId/auth/:method') name: 'updateAuthStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false) @@ -839,9 +884,12 @@ App::patch('/v1/projects/:projectId/auth/password-history') name: 'updateAuthPasswordHistory', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0') @@ -873,9 +921,12 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') name: 'updateAuthPasswordDictionary', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.') @@ -907,9 +958,12 @@ App::patch('/v1/projects/:projectId/auth/personal-data') name: 'updatePersonalDataCheck', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.') @@ -941,9 +995,12 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') name: 'updateAuthSessionsLimit', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT) @@ -975,9 +1032,12 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') name: 'updateMockNumbers', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.') @@ -1018,9 +1078,12 @@ App::delete('/v1/projects/:projectId') name: 'delete', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1057,9 +1120,12 @@ App::post('/v1/projects/:projectId/webhooks') name: 'createWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') @@ -1118,9 +1184,12 @@ App::get('/v1/projects/:projectId/webhooks') name: 'listWebhooks', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1153,9 +1222,12 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') name: 'getWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1190,9 +1262,12 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') name: 'updateWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1252,9 +1327,12 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') name: 'updateWebhookSignature', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1294,9 +1372,12 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') name: 'deleteWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1337,9 +1418,12 @@ App::post('/v1/projects/:projectId/keys') name: 'createKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') @@ -1390,9 +1474,12 @@ App::get('/v1/projects/:projectId/keys') name: 'listKeys', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1425,9 +1512,12 @@ App::get('/v1/projects/:projectId/keys/:keyId') name: 'getKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1462,9 +1552,12 @@ App::put('/v1/projects/:projectId/keys/:keyId') name: 'updateKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1511,9 +1604,12 @@ App::delete('/v1/projects/:projectId/keys/:keyId') name: 'deleteKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1554,9 +1650,12 @@ App::post('/v1/projects/:projectId/jwts') name: 'createJWT', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_JWT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') @@ -1593,9 +1692,12 @@ App::post('/v1/projects/:projectId/platforms') name: 'createPlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') @@ -1646,9 +1748,12 @@ App::get('/v1/projects/:projectId/platforms') name: 'listPlatforms', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1681,9 +1786,12 @@ App::get('/v1/projects/:projectId/platforms/:platformId') name: 'getPlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1718,9 +1826,12 @@ App::put('/v1/projects/:projectId/platforms/:platformId') name: 'updatePlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1769,9 +1880,12 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') name: 'deletePlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1812,9 +1926,12 @@ App::patch('/v1/projects/:projectId/smtp') name: 'updateSmtp', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') @@ -1905,9 +2022,12 @@ App::post('/v1/projects/:projectId/smtp/tests') name: 'createSmtpTest', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') @@ -1968,9 +2088,12 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'getSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2012,9 +2135,12 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') name: 'getEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') @@ -2067,9 +2193,12 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'updateSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2110,9 +2239,12 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') name: 'updateEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') @@ -2163,9 +2295,12 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'deleteSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2209,9 +2344,12 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') name: 'deleteEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 8818de0d54..2476bfdaba 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -7,7 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -36,9 +36,12 @@ App::post('/v1/proxy/rules') name: 'createRule', description: '/docs/references/proxy/create-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"') @@ -160,9 +163,12 @@ App::get('/v1/proxy/rules') name: 'listRules', description: '/docs/references/proxy/list-rules.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE_LIST, + ) + ] )) ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -231,9 +237,12 @@ App::get('/v1/proxy/rules/:ruleId') name: 'getRule', description: '/docs/references/proxy/get-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') @@ -265,8 +274,12 @@ App::delete('/v1/proxy/rules/:ruleId') name: 'deleteRule', description: '/docs/references/proxy/delete-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') @@ -304,9 +317,12 @@ App::patch('/v1/proxy/rules/:ruleId/verification') name: 'updateRuleVerification', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index fe4bba7640..59e831f057 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -11,6 +11,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; @@ -63,9 +64,12 @@ App::post('/v1/storage/buckets') name: 'createBucket', description: '/docs/references/storage/create-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Bucket name') @@ -161,9 +165,12 @@ App::get('/v1/storage/buckets') name: 'listBuckets', description: '/docs/references/storage/list-buckets.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET_LIST, + ) + ] )) ->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -224,9 +231,12 @@ App::get('/v1/storage/buckets/:bucketId') name: 'getBucket', description: '/docs/references/storage/get-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -255,9 +265,12 @@ App::put('/v1/storage/buckets/:bucketId') name: 'updateBucket', description: '/docs/references/storage/update-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->param('name', null, new Text(128), 'Bucket name', false) @@ -321,8 +334,12 @@ App::delete('/v1/storage/buckets/:bucketId') name: 'deleteBucket', description: '/docs/references/storage/delete-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -371,9 +388,12 @@ App::post('/v1/storage/buckets/:bucketId/files') methodType: MethodType::UPLOAD, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], requestType: 'multipart/form-data', - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -735,9 +755,12 @@ App::get('/v1/storage/buckets/:bucketId/files') name: 'listFiles', description: '/docs/references/storage/list-files.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE_LIST, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true) @@ -829,9 +852,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') name: 'getFile', description: '/docs/references/storage/get-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -882,10 +908,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') name: 'getFilePreview', description: '/docs/references/storage/get-file-preview.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::IMAGE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') @@ -1055,10 +1085,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') name: 'getFileDownload', description: '/docs/references/storage/get-file-download.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::ANY, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1199,10 +1233,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') name: 'getFileView', description: '/docs/references/storage/get-file-view.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::ANY, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1515,9 +1553,12 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') name: 'updateFile', description: '/docs/references/storage/update-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') @@ -1626,8 +1667,12 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') name: 'deleteFile', description: '/docs/references/storage/delete-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1720,9 +1765,12 @@ App::get('/v1/storage/usage') name: 'getUsage', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_USAGE_STORAGE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_STORAGE, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') @@ -1803,9 +1851,12 @@ App::get('/v1/storage/:bucketId/usage') name: 'getBucketUsage', description: '/docs/references/storage/get-bucket-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_USAGE_BUCKETS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_BUCKETS, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fc249e9c48..f364e4d871 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -61,9 +61,12 @@ App::post('/v1/teams') name: 'create', description: '/docs/references/teams/create-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TEAM, + ) + ] )) ->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') @@ -148,9 +151,12 @@ App::get('/v1/teams') name: 'list', description: '/docs/references/teams/list-teams.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM_LIST, + ) + ], offlineModel: '/teams', )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) @@ -214,9 +220,12 @@ App::get('/v1/teams/:teamId') name: 'get', description: '/docs/references/teams/get-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ], offlineModel: '/teams', offlineKey: '{teamId}', )) @@ -243,9 +252,12 @@ App::get('/v1/teams/:teamId/prefs') name: 'getPrefs', description: '/docs/references/teams/get-team-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], offlineModel: '/teams/{teamId}/prefs', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -276,9 +288,12 @@ App::put('/v1/teams/:teamId') name: 'updateName', description: '/docs/references/teams/update-team-name.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ], offlineModel: '/teams', offlineKey: '{teamId}', )) @@ -322,9 +337,12 @@ App::put('/v1/teams/:teamId/prefs') name: 'updatePrefs', description: '/docs/references/teams/update-team-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], offlineModel: '/teams/{teamId}/prefs', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -359,8 +377,12 @@ App::delete('/v1/teams/:teamId') name: 'delete', description: '/docs/references/teams/delete-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -412,9 +434,12 @@ App::post('/v1/teams/:teamId/memberships') name: 'createMembership', description: '/docs/references/teams/create-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->label('abuse-limit', 10) ->param('teamId', '', new UID(), 'Team ID.') @@ -739,9 +764,12 @@ App::get('/v1/teams/:teamId/memberships') name: 'listMemberships', description: '/docs/references/teams/list-team-members.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ], offlineModel: '/teams/{teamId}/memberships', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -872,9 +900,12 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') name: 'getMembership', description: '/docs/references/teams/get-team-member.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ], offlineModel: '/teams/{teamId}/memberships', offlineKey: '{membershipId}', )) @@ -955,9 +986,12 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') name: 'updateMembership', description: '/docs/references/teams/update-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1040,9 +1074,12 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') name: 'updateMembershipStatus', description: '/docs/references/teams/update-team-membership-status.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1179,9 +1216,12 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') name: 'deleteMembership', description: '/docs/references/teams/delete-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1245,9 +1285,12 @@ App::get('/v1/teams/:teamId/logs') name: 'listLogs', description: '/docs/references/teams/get-team-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 2898567280..b80bce1a2b 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -17,7 +17,7 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -200,9 +200,12 @@ App::post('/v1/users') name: 'create', description: '/docs/references/users/create-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) @@ -231,9 +234,12 @@ App::post('/v1/users/bcrypt') name: 'createBcryptUser', description: '/docs/references/users/create-bcrypt-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -262,9 +268,12 @@ App::post('/v1/users/md5') name: 'createMD5User', description: '/docs/references/users/create-md5-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -293,9 +302,12 @@ App::post('/v1/users/argon2') name: 'createArgon2User', description: '/docs/references/users/create-argon2-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -324,9 +336,12 @@ App::post('/v1/users/sha') name: 'createSHAUser', description: '/docs/references/users/create-sha-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -362,9 +377,12 @@ App::post('/v1/users/phpass') name: 'createPHPassUser', description: '/docs/references/users/create-phpass-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -393,9 +411,12 @@ App::post('/v1/users/scrypt') name: 'createScryptUser', description: '/docs/references/users/create-scrypt-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -437,9 +458,12 @@ App::post('/v1/users/scrypt-modified') name: 'createScryptModifiedUser', description: '/docs/references/users/create-scrypt-modified-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -472,9 +496,12 @@ App::post('/v1/users/:userId/targets') name: 'createTarget', description: '/docs/references/users/create-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ] )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('userId', '', new UID(), 'User ID.') @@ -560,9 +587,12 @@ App::get('/v1/users') name: 'list', description: '/docs/references/users/list-users.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER_LIST, + ) + ] )) ->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -622,9 +652,12 @@ App::get('/v1/users/:userId') name: 'get', description: '/docs/references/users/get-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -649,9 +682,12 @@ App::get('/v1/users/:userId/prefs') name: 'getPrefs', description: '/docs/references/users/get-user-prefs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -678,9 +714,12 @@ App::get('/v1/users/:userId/targets/:targetId') name: 'getTarget', description: '/docs/references/users/get-user-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -712,9 +751,12 @@ App::get('/v1/users/:userId/sessions') name: 'listSessions', description: '/docs/references/users/list-user-sessions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -755,9 +797,12 @@ App::get('/v1/users/:userId/memberships') name: 'listMemberships', description: '/docs/references/users/list-user-memberships.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -796,9 +841,12 @@ App::get('/v1/users/:userId/logs') name: 'listLogs', description: '/docs/references/users/list-user-logs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -887,9 +935,12 @@ App::get('/v1/users/:userId/targets') name: 'listTargets', description: '/docs/references/users/list-user-targets.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) @@ -949,9 +1000,12 @@ App::get('/v1/users/identities') name: 'listIdentities', description: '/docs/references/users/list-identities.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_IDENTITY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ] )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1015,9 +1069,12 @@ App::patch('/v1/users/:userId/status') name: 'updateStatus', description: '/docs/references/users/update-user-status.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.') @@ -1052,9 +1109,12 @@ App::put('/v1/users/:userId/labels') name: 'updateLabels', description: '/docs/references/users/update-user-labels.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.') @@ -1091,9 +1151,12 @@ App::patch('/v1/users/:userId/verification/phone') name: 'updatePhoneVerification', description: '/docs/references/users/update-user-phone-verification.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('phoneVerification', false, new Boolean(), 'User phone verification status.') @@ -1129,9 +1192,12 @@ App::patch('/v1/users/:userId/name') name: 'updateName', description: '/docs/references/users/update-user-name.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.') @@ -1168,9 +1234,12 @@ App::patch('/v1/users/:userId/password') name: 'updatePassword', description: '/docs/references/users/update-user-password.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -1247,9 +1316,12 @@ App::patch('/v1/users/:userId/email') name: 'updateEmail', description: '/docs/references/users/update-user-email.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('email', '', new Email(allowEmpty: true), 'User email.') @@ -1343,9 +1415,12 @@ App::patch('/v1/users/:userId/phone') name: 'updatePhone', description: '/docs/references/users/update-user-phone.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('number', '', new Phone(allowEmpty: true), 'User phone number.') @@ -1429,9 +1504,12 @@ App::patch('/v1/users/:userId/verification') name: 'updateEmailVerification', description: '/docs/references/users/update-user-email-verification.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('emailVerification', false, new Boolean(), 'User email verification status.') @@ -1463,9 +1541,12 @@ App::patch('/v1/users/:userId/prefs') name: 'updatePrefs', description: '/docs/references/users/update-user-prefs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') @@ -1500,9 +1581,12 @@ App::patch('/v1/users/:userId/targets/:targetId') name: 'updateTarget', description: '/docs/references/users/update-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -1601,9 +1685,12 @@ App::patch('/v1/users/:userId/mfa') name: 'updateMfa', description: '/docs/references/users/update-user-mfa.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') @@ -1637,9 +1724,12 @@ App::get('/v1/users/:userId/mfa/factors') name: 'listMfaFactors', description: '/docs/references/users/list-mfa-factors.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_FACTORS, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1672,9 +1762,12 @@ App::get('/v1/users/:userId/mfa/recovery-codes') name: 'getMfaRecoveryCodes', description: '/docs/references/users/get-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1713,9 +1806,12 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') name: 'createMfaRecoveryCodes', description: '/docs/references/users/create-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1761,9 +1857,12 @@ App::put('/v1/users/:userId/mfa/recovery-codes') name: 'updateMfaRecoveryCodes', description: '/docs/references/users/update-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1808,9 +1907,12 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') name: 'deleteMfaAuthenticator', description: '/docs/references/users/delete-mfa-authenticator.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -1851,9 +1953,12 @@ App::post('/v1/users/:userId/sessions') name: 'createSession', description: '/docs/references/users/create-session.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->inject('request') @@ -1922,9 +2027,12 @@ App::post('/v1/users/:userId/tokens') name: 'createToken', description: '/docs/references/users/create-token.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TOKEN, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true) @@ -1981,9 +2089,12 @@ App::delete('/v1/users/:userId/sessions/:sessionId') name: 'deleteSession', description: '/docs/references/users/delete-user-session.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2027,9 +2138,12 @@ App::delete('/v1/users/:userId/sessions') name: 'deleteSessions', description: '/docs/references/users/delete-user-sessions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2072,9 +2186,12 @@ App::delete('/v1/users/:userId') name: 'delete', description: '/docs/references/users/delete.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2117,9 +2234,12 @@ App::delete('/v1/users/:userId/targets/:targetId') name: 'deleteTarget', description: '/docs/references/users/delete-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2170,9 +2290,12 @@ App::delete('/v1/users/identities/:identityId') name: 'deleteIdentity', description: '/docs/references/users/delete-identity.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') @@ -2205,9 +2328,12 @@ App::post('/v1/users/:userId/jwts') name: 'createJWT', description: '/docs/references/users/create-user-jwt.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_JWT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true) @@ -2257,9 +2383,12 @@ App::get('/v1/users/usage') name: 'getUsage', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_USERS, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_USERS, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 526fee27f9..3e31908bf9 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; @@ -278,8 +279,12 @@ App::get('/v1/vcs/github/authorize') name: 'createGitHubInstallation', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, methodType: MethodType::WEBAUTH, hide: true, @@ -480,9 +485,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'getRepositoryContents', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_VCS_CONTENT_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VCS_CONTENT_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -543,9 +551,12 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr name: 'createRepositoryDetection', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_DETECTION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DETECTION, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -617,9 +628,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') name: 'listRepositories', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -714,9 +728,12 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') name: 'createRepository', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('name', '', new Text(256), 'Repository name (slug)') @@ -817,9 +834,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'getRepository', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -868,9 +888,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'listRepositoryBranches', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_BRANCH_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BRANCH_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -1058,9 +1081,12 @@ App::get('/v1/vcs/installations') name: 'listInstallations', description: '/docs/references/vcs/list-installations.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_INSTALLATION_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION_LIST, + ) + ] )) ->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1126,9 +1152,12 @@ App::get('/v1/vcs/installations/:installationId') name: 'getInstallation', description: '/docs/references/vcs/get-installation.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_INSTALLATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') @@ -1157,8 +1186,12 @@ App::delete('/v1/vcs/installations/:installationId') name: 'deleteInstallation', description: '/docs/references/vcs/delete-installation.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_NOCONTENT + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') @@ -1192,8 +1225,12 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor name: 'updateExternalDeployments', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_NOCONTENT + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('repositoryId', '', new Text(256), 'VCS Repository Id') diff --git a/composer.lock b/composer.lock index f5a7dd7906..3dafef7083 100644 --- a/composer.lock +++ b/composer.lock @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.29.0", + "version": "v4.29.2", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" + "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", - "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/79aa5014efeeec3d137df5cdb0ae2fc163953945", + "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.2" }, - "time": "2024-11-27T18:37:40+00:00" + "time": "2024-12-18T14:11:12+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1237,16 +1237,16 @@ }, { "name": "open-telemetry/api", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6" + "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/542064815d38a6df55af7957cd6f1d7d967c99c6", - "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", + "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", "shasum": "" }, "require": { @@ -1260,13 +1260,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.1.x-dev" - }, "spi": { "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] + }, + "branch-alias": { + "dev-main": "1.1.x-dev" } }, "autoload": { @@ -1303,7 +1303,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-15T22:42:37+00:00" + "time": "2024-11-16T04:32:30+00:00" }, { "name": "open-telemetry/context", @@ -1530,13 +1530,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.0.x-dev" - }, "spi": { "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] + }, + "branch-alias": { + "dev-main": "1.0.x-dev" } }, "autoload": { @@ -2403,12 +2403,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2453,23 +2453,23 @@ }, { "name": "symfony/http-client", - "version": "v7.2.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" + "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", - "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", + "url": "https://api.github.com/repos/symfony/http-client/zipball/ff4df2b68d1c67abb9fef146e6540ea16b58d99e", + "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "~3.4.3|^3.5.1", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -2528,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.0" + "source": "https://github.com/symfony/http-client/tree/v7.2.1" }, "funding": [ { @@ -2544,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-29T08:22:02+00:00" + "time": "2024-12-07T08:50:44+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.1", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", "shasum": "" }, "require": { @@ -2565,12 +2565,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2606,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" }, "funding": [ { @@ -2622,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T12:02:18+00:00" + "time": "2024-12-07T08:49:48+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2650,8 +2650,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2724,8 +2724,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2804,8 +2804,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2884,12 +2884,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2970,10 +2970,10 @@ }, "type": "composer-plugin", "extra": { + "class": "Nevay\\SPI\\Composer\\Plugin", "branch-alias": { "dev-main": "0.2.x-dev" }, - "class": "Nevay\\SPI\\Composer\\Plugin", "plugin-optional": true }, "autoload": { @@ -3678,16 +3678,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.14", + "version": "0.33.15", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850" + "reference": "83b0628900c2c53e8c3efbf069f3e13050295edc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850", + "url": "https://api.github.com/repos/utopia-php/http/zipball/83b0628900c2c53e8c3efbf069f3e13050295edc", + "reference": "83b0628900c2c53e8c3efbf069f3e13050295edc", "shasum": "" }, "require": { @@ -3719,9 +3719,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.14" + "source": "https://github.com/utopia-php/http/tree/0.33.15" }, - "time": "2024-11-20T12:39:10+00:00" + "time": "2024-12-10T13:07:04+00:00" }, { "name": "utopia-php/image", @@ -4363,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.7", + "version": "0.18.8", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", - "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/84737afa634e6a833fc4f8b0c967553234d3f215", + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215", "shasum": "" }, "require": { @@ -4412,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.7" + "source": "https://github.com/utopia-php/storage/tree/0.18.8" }, - "time": "2024-11-28T11:10:53+00:00" + "time": "2024-12-04T08:30:35+00:00" }, { "name": "utopia-php/swoole", @@ -4575,16 +4575,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.5", + "version": "0.8.6", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "7622330628d53844a3873ca873338150756bab82" + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82", - "reference": "7622330628d53844a3873ca873338150756bab82", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b10225f54d5670f09f83e82e09de9d820ada6931", + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931", "shasum": "" }, "require": { @@ -4618,9 +4618,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.5" + "source": "https://github.com/utopia-php/vcs/tree/0.8.6" }, - "time": "2024-11-11T18:33:10+00:00" + "time": "2024-12-10T13:13:23+00:00" }, { "name": "utopia-php/websocket", @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.25", + "version": "0.39.27", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1" + "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5b5323636a8d75a1c4faaae9728098dd6a6a47d1", - "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/27d8ecde30e40cbfe1124cc0430c406d3e144849", + "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849", "shasum": "" }, "require": { @@ -4852,9 +4852,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.25" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.27" }, - "time": "2024-11-08T10:16:34+00:00" + "time": "2024-12-16T11:32:02+00:00" }, { "name": "doctrine/annotations", @@ -4934,29 +4934,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -4964,7 +4962,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4975,9 +4973,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -5809,16 +5807,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -5867,9 +5865,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-11-12T11:25:25+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -7578,16 +7576,16 @@ }, { "name": "symfony/console", - "version": "v7.2.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -7651,7 +7649,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.0" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -7667,7 +7665,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:24:19+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/filesystem", @@ -7892,8 +7890,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -7968,8 +7966,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8046,8 +8044,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8124,8 +8122,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8558,7 +8556,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index ce4c55c9d8..e1dffaf099 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -87,12 +87,16 @@ class Method $this->validateAuthTypes($auth); // Disabled for now, will be enabled later // $this->validateDesc($description); - $this->validateResponseModel($responseModel); - // No content check - if ($responseCode === 204) { - if ($responseModel !== Response::MODEL_NONE) { - throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + foreach ($responses as $response) { + /** @var \Appwrite\SDK\Response $response */ + $this->validateResponseModel($response->getModel()); + + // No content check + if ($response->getCode() === 204) { + if ($response->getModel() !== Response::MODEL_NONE) { + throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + } } } } @@ -176,14 +180,9 @@ class Method return $this->auth; } - public function getResponseCode(): int + public function getResponses(): array { - return $this->responseCode; - } - - public function getResponseModel(): string|array - { - return $this->responseModel; + return $this->responses; } public function getResponseType(): ResponseType diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php index 7b521549cb..9cd72951dc 100644 --- a/src/Appwrite/SDK/Response.php +++ b/src/Appwrite/SDK/Response.php @@ -6,22 +6,22 @@ class Response { /** * @param int $code - * @param string $model + * @param string|array $model * @param string $description */ - function __construct( + public function __construct( private int $code, - private string $model, + private string|array $model, private string $description = '', - ) - {} + ) { + } public function getCode(): int { return $this->code; } - public function getModel(): string + public function getModel(): string|array { return $this->model; } @@ -30,4 +30,4 @@ class Response { return $this->description; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 842c473e78..9ed35f3c4c 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -142,7 +142,6 @@ class OpenAPI3 extends Format $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; $produces = ($sdk->getResponseType())->value; - $model = $sdk->getResponseModel() ?? 'none'; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -210,68 +209,74 @@ class OpenAPI3 extends Format } } - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + // Handle response models + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); + + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } } - } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); - - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); - } - - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $modelDescription, - 'content' => [ - $produces => [ - 'schema' => [ - 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) - ], - ], - ], + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $model->getName(), - 'content' => [ - $produces => [ - 'schema' => [ - '$ref' => '#/components/schemas/' . $model->getType(), + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'content' => [ + $produces => [ + 'schema' => [ + 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) + ], ], ], - ], - ]; + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'content' => [ + $produces => [ + 'schema' => [ + '$ref' => '#/components/schemas/' . $model->getType(), + ], + ], + ], + ]; + } } - } - if (($sdk->getResponseCode() ?? 500) === 204) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; - unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); + if (($response->getCode() ?? 500) === 204) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 952064faaf..6f704366da 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -138,7 +138,6 @@ class Swagger2 extends Format $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; $produces = ($sdk->getResponseType())->value; - $model = $sdk->getResponseModel() ?? 'none'; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -212,63 +211,70 @@ class Swagger2 extends Format } } - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + // Handle Responses + + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); + + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } } - } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - 'schema' => [ - 'type' => 'file' - ], - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); - } - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $modelDescription, + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', 'schema' => [ - 'x-oneOf' => \array_map(function ($m) { - return ['$ref' => '#/definitions/' . $m->getType()]; - }, $model) + 'type' => 'file' ], ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $model->getName(), - 'schema' => [ - '$ref' => '#/definitions/' . $model->getType(), - ], - ]; + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'schema' => [ + 'x-oneOf' => \array_map(function ($m) { + return ['$ref' => '#/definitions/' . $m->getType()]; + }, $model) + ], + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'schema' => [ + '$ref' => '#/definitions/' . $model->getType(), + ], + ]; + } } - } - if (in_array($sdk->getResponseCode() ?? 500, [204, 301, 302, 308], true)) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; - unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); + if (in_array($response->getCode() ?? 500, [204, 301, 302, 308], true)) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope From 0d6095ba18b6dce3d216c92fb0bbdead5801de1d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 3 Jan 2025 14:16:26 +0000 Subject: [PATCH 071/161] Add improved error handling for SDK Class --- app/http.php | 2 ++ composer.lock | 42 ++++++++++++++++++------------------- src/Appwrite/SDK/Method.php | 32 ++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/app/http.php b/app/http.php index 641143694d..42a9010482 100644 --- a/app/http.php +++ b/app/http.php @@ -2,6 +2,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; +use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Swoole\Constant; @@ -335,4 +336,5 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); +Method::finaliseInitialization(); $http->start(); diff --git a/composer.lock b/composer.lock index 3dafef7083..e42376d236 100644 --- a/composer.lock +++ b/composer.lock @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.27", + "version": "0.39.28", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849" + "reference": "6ff467858fe418e364460da905139216570a5d5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/27d8ecde30e40cbfe1124cc0430c406d3e144849", - "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6ff467858fe418e364460da905139216570a5d5e", + "reference": "6ff467858fe418e364460da905139216570a5d5e", "shasum": "" }, "require": { @@ -4852,9 +4852,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.27" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.28" }, - "time": "2024-12-16T11:32:02+00:00" + "time": "2024-12-30T11:17:25+00:00" }, { "name": "doctrine/annotations", @@ -5126,16 +5126,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.3", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" + "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", - "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", + "url": "https://api.github.com/repos/laravel/pint/zipball/8169513746e1bac70c85d6ea1524d9225d4886f0", + "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0", "shasum": "" }, "require": { @@ -5146,10 +5146,10 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.65.0", - "illuminate/view": "^10.48.24", - "larastan/larastan": "^2.9.11", - "laravel-zero/framework": "^10.4.0", + "friendsofphp/php-cs-fixer": "^3.66.0", + "illuminate/view": "^10.48.25", + "larastan/larastan": "^2.9.12", + "laravel-zero/framework": "^10.48.25", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^1.17.0", "pestphp/pest": "^2.36.0" @@ -5188,7 +5188,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-26T15:34:00+00:00" + "time": "2024-12-30T16:20:10+00:00" }, { "name": "matthiasmullie/minify", @@ -5376,16 +5376,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -5428,9 +5428,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index e1dffaf099..afae57b0d3 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -37,6 +37,11 @@ class Method { public static array $knownMethods = []; + //Tmp + public static array $knownMissingDescriptions = []; + + public static array $exceptions = []; + /** * @var array */ @@ -85,8 +90,7 @@ class Method ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); - // Disabled for now, will be enabled later - // $this->validateDesc($description); + $this->validateDesc($description); foreach ($responses as $response) { /** @var \Appwrite\SDK\Response $response */ @@ -95,7 +99,7 @@ class Method // No content check if ($response->getCode() === 204) { if ($response->getModel() !== Response::MODEL_NONE) { - throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"; } } } @@ -109,7 +113,7 @@ class Method private function validateMethod(string $name, string $namespace): void { if (\in_array($this->getDebugName(), self::$knownMethods)) { - throw new \Exception('Method ' . $name . ' already exists in namespace ' . $namespace); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Method already exists in namespace {$namespace}"; } self::$knownMethods[] = $this->getDebugName(); @@ -119,7 +123,7 @@ class Method { foreach ($authTypes as $authType) { if (!($authType instanceof AuthType)) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid auth type"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid auth type"; } } } @@ -127,13 +131,15 @@ class Method private function validateDesc(string $desc): void { if (empty($desc)) { - throw new \Exception("Error with {$this->getDebugName()} method: Description file not set"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Description label is empty"; + return; } $descPath = \realpath(__DIR__ . '/../../../' . $desc); if (!\file_exists($descPath)) { - throw new \Exception("Error with {$this->getDebugName()} method: Description file not found at {$descPath}"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Description file not found at {$desc}"; + return; } } @@ -146,7 +152,7 @@ class Method try { $response->getModel($model); } catch (\Exception $e) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -156,7 +162,7 @@ class Method try { $response->getModel($responseModel); } catch (\Exception $e) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -239,4 +245,12 @@ class Method { return $this->multiplex; } + + // Throw any errors that were found during initialization + static function finaliseInitialization(): void + { + if (!empty(self::$exceptions)) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$exceptions)); + } + } } From 87de19b61070f6d5983f69b176befb450e94bc5d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 02:07:56 +0900 Subject: [PATCH 072/161] Address Comments --- app/config/specs/open-api3-latest-client.json | 23 ++-- .../specs/open-api3-latest-console.json | 23 ++-- app/config/specs/open-api3-latest-server.json | 23 ++-- app/config/specs/swagger2-latest-client.json | 41 +++---- app/config/specs/swagger2-latest-console.json | 41 +++---- app/config/specs/swagger2-latest-server.json | 41 +++---- app/controllers/api/databases.php | 67 +++++++----- src/Appwrite/GraphQL/Schema.php | 8 ++ src/Appwrite/Platform/Tasks/Specs.php | 101 ++++++++++-------- src/Appwrite/SDK/AuthType.php | 11 ++ src/Appwrite/SDK/Method.php | 90 +++++----------- src/Appwrite/SDK/MethodType.php | 11 ++ src/Appwrite/SDK/ResponseType.php | 15 +++ .../Specification/Format/OpenAPI3.php | 45 ++++++-- .../Specification/Format/Swagger2.php | 46 ++++++-- 15 files changed, 306 insertions(+), 280 deletions(-) create mode 100644 src/Appwrite/SDK/AuthType.php create mode 100644 src/Appwrite/SDK/MethodType.php create mode 100644 src/Appwrite/SDK/ResponseType.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index cffba28434..9164bb0a7f 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4564,22 +4564,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -4589,7 +4574,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a9afe4b0e1..484b25e18e 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8133,22 +8133,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -8158,7 +8143,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 4960002943..0656264d09 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,22 +7667,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -7692,7 +7677,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 2bb9cd265c..65e28ff79d 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4752,22 +4752,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -4777,7 +4762,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -4817,14 +4806,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -4838,14 +4827,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index bde121a094..5ac694787c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8336,22 +8336,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -8361,7 +8346,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -8401,14 +8390,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -8422,14 +8411,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index f51bba17cd..64544d2a03 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7848,22 +7848,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -7873,7 +7858,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -7915,14 +7904,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -7936,14 +7925,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 5c7479ffac..124de445c3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3096,35 +3096,46 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label( 'sdk', - new Method( - namespace: 'databases', - name: 'createDocument', - description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, - ) - ], - responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - multiplex: [ - new Multiplex( - name: 'createDocument', - parameters: ['documentId', 'data', 'permissions'], - required: ['documentId', 'data'], - responseModel: Response::MODEL_DOCUMENT, - ), - new Multiplex( + [ + new Method( + namespace: 'databases', + name: 'createDocument', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documentId' => ['default' => [], 'validator' => new CustomId(), 'description' => '', 'optional' => false], + 'data' => ['default' => [], 'validator' => new JSON(), 'description' => '', 'optional' => false], + 'permissions' => ['default' => [], 'validator' => new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'description' => '', 'optional' => true], + ] + ), + new Method( + namespace: 'databases', name: 'createDocuments', - parameters: ['documents'], - required: ['documents'], - responseModel: Response::MODEL_DOCUMENT_LIST, - ), - ] - ) + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + ] + ) + ] ) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index b8daadefef..44a85d2d27 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -105,6 +105,14 @@ class Schema continue; } + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + $namespace = $sdk->getNamespace(); $method = $sdk->getMethodName(); $name = $namespace . \ucfirst($method); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 6229899a9a..627ac8c912 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -183,62 +183,69 @@ class Specs extends Action foreach ($appRoutes as $key => $method) { foreach ($method as $route) { - $sdk = $route->getLabel('sdk', false); + $sdks = $route->getLabel('sdk', false); - /** @var \Appwrite\SDK\Method $sdk */ - if (empty($sdk)) { + if (empty($sdks)) { continue; } - $hide = $sdk->isHidden(); - if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { - continue; + if (!\is_array($sdks)) { + $sdks = [$sdks]; } - $routeSecurity = $sdk->getAuth(); - $sdkPlatforms = []; + foreach ($sdks as $sdk) { + /** @var \Appwrite\SDK\Method $sdks */ - foreach ($routeSecurity as $value) { - switch ($value) { - case AuthType::SESSION: - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - break; - case AuthType::JWT: - case AuthType::KEY: - $sdkPlatforms[] = APP_PLATFORM_SERVER; - break; - case AuthType::ADMIN: - $sdkPlatforms[] = APP_PLATFORM_CONSOLE; - break; + $hide = $sdk->isHidden(); + if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { + continue; } + + $routeSecurity = $sdk->getAuth(); + $sdkPlatforms = []; + + foreach ($routeSecurity as $value) { + switch ($value) { + case AuthType::SESSION: + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + break; + case AuthType::JWT: + case AuthType::KEY: + $sdkPlatforms[] = APP_PLATFORM_SERVER; + break; + case AuthType::ADMIN: + $sdkPlatforms[] = APP_PLATFORM_CONSOLE; + break; + } + } + + if (empty($routeSecurity)) { + $sdkPlatforms[] = APP_PLATFORM_SERVER; + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + } + + if (!$route->getLabel('docs', true)) { + continue; + } + + if ($route->getLabel('mock', false) && !$mocks) { + continue; + } + + if (!$route->getLabel('mock', false) && $mocks) { + continue; + } + + if (empty($sdk->getNamespace())) { + continue; + } + + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { + continue; + } + + $routes[] = $route; } - - if (empty($routeSecurity)) { - $sdkPlatforms[] = APP_PLATFORM_SERVER; - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - } - - if (!$route->getLabel('docs', true)) { - continue; - } - - if ($route->getLabel('mock', false) && !$mocks) { - continue; - } - - if (!$route->getLabel('mock', false) && $mocks) { - continue; - } - - if (empty($sdk->getNamespace())) { - continue; - } - - if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { - continue; - } - - $routes[] = $route; } } diff --git a/src/Appwrite/SDK/AuthType.php b/src/Appwrite/SDK/AuthType.php new file mode 100644 index 0000000000..e2ae5ead4d --- /dev/null +++ b/src/Appwrite/SDK/AuthType.php @@ -0,0 +1,11 @@ + - */ - protected array $multiplexRoutes = []; + public static array $errors = []; /** * Initialise a new SDK method @@ -54,7 +19,7 @@ class Method * @param string $name * @param string $description * @param array $auth - * @param array $responses + * @param array $responses * @param int $responseCode * @param string|array $responseModel * @param ResponseType $responseType @@ -85,45 +50,40 @@ class Method protected array|bool $hide = false, protected bool $packaging = false, protected string $requestType = 'application/json', - protected array $parameters = [], - protected array $multiplex = [] + protected array $parameters = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); - $this->validateDesc($description); + //$this->validateDesc($description); foreach ($responses as $response) { - /** @var \Appwrite\SDK\Response $response */ + /** @var SDKResponse $response */ $this->validateResponseModel($response->getModel()); // No content check - if ($response->getCode() === 204) { - if ($response->getModel() !== Response::MODEL_NONE) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"; - } - } + $this->validateNoContent($response); } } - private function getDebugName(): string + private function getRouteName(): string { return $this->namespace . '.' . $this->name; } private function validateMethod(string $name, string $namespace): void { - if (\in_array($this->getDebugName(), self::$knownMethods)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Method already exists in namespace {$namespace}"; + if (\in_array($this->getRouteName(), self::$knownMethods)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Method already exists in namespace {$namespace}"; } - self::$knownMethods[] = $this->getDebugName(); + self::$knownMethods[] = $this->getRouteName(); } private function validateAuthTypes(array $authTypes): void { foreach ($authTypes as $authType) { if (!($authType instanceof AuthType)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid auth type"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid auth type"; } } } @@ -131,14 +91,14 @@ class Method private function validateDesc(string $desc): void { if (empty($desc)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Description label is empty"; + self::$errors[] = "Error with {$this->getRouteName()} method: Description label is empty"; return; } $descPath = \realpath(__DIR__ . '/../../../' . $desc); if (!\file_exists($descPath)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Description file not found at {$desc}"; + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; return; } } @@ -152,7 +112,7 @@ class Method try { $response->getModel($model); } catch (\Exception $e) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -162,7 +122,16 @@ class Method try { $response->getModel($responseModel); } catch (\Exception $e) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + } + } + + private function validateNoContent(SDKResponse $response): void + { + if ($response->getCode() === 204) { + if ($response->getModel() !== Response::MODEL_NONE) { + self::$errors[] = "Error with {$this->getRouteName()} method: Response code 204 must have response model 'none'"; + } } } @@ -241,16 +210,11 @@ class Method return $this->parameters; } - public function getMultiplex(): array - { - return $this->multiplex; - } - // Throw any errors that were found during initialization static function finaliseInitialization(): void { - if (!empty(self::$exceptions)) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$exceptions)); + if (!empty(self::$errors)) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); } } } diff --git a/src/Appwrite/SDK/MethodType.php b/src/Appwrite/SDK/MethodType.php new file mode 100644 index 0000000000..b4982c847a --- /dev/null +++ b/src/Appwrite/SDK/MethodType.php @@ -0,0 +1,11 @@ +getMultiplex())) { - $temp['x-appwrite']['multiplex'] = []; - foreach ($sdk->getMultiplex() as $multiplex) { - /** @var \Appwrite\SDK\Multiplex $multiplex */ - $temp['x-appwrite']['multiplex'][] = [ - 'name' => $multiplex->getName(), - 'parameters' => $multiplex->getParameters(), - 'required' => $multiplex->getRequired(), - 'responses' => ['#/components/schemas/' . $multiplex->getResponseModel()] + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [] ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'description' => $response->getDescription(), + 'model' => '#/components/schemas/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 6f704366da..34f6c99b37 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -128,6 +128,14 @@ class Swagger2 extends Format continue; } + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + $consumes = [$sdk->getRequestType()]; $method = $sdk->getMethodName() ?? \uniqid(); @@ -197,17 +205,35 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = []; - foreach ($sdk->getMultiplex() as $multiplex) { - /** @var \Appwrite\SDK\Multiplex $multiplex */ - - $temp['x-appwrite']['multiplex'][] = [ - 'name' => $multiplex->getName(), - 'parameters' => $multiplex->getParameters(), - 'required' => $multiplex->getRequired(), - 'responses' => ["#/definitions/" . $multiplex->getResponseModel()] + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [] ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'description' => $response->getDescription(), + 'model' => '#/definitions/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } From a1c70a695623d2d2f854c584bc4155f9e8ee9ae3 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 14:23:04 +0900 Subject: [PATCH 073/161] Run Formatter, Fix GraphQL --- app/controllers/api/databases.php | 33 ++++++++------- app/controllers/shared/api.php | 4 ++ src/Appwrite/GraphQL/Schema.php | 2 +- src/Appwrite/GraphQL/Types/Mapper.php | 31 +++++++++++--- src/Appwrite/Platform/Tasks/Specs.php | 18 ++++----- src/Appwrite/SDK/AuthType.php | 2 +- src/Appwrite/SDK/Method.php | 9 +++-- src/Appwrite/SDK/MethodType.php | 2 +- src/Appwrite/SDK/Multiplex.php | 40 ------------------- src/Appwrite/SDK/ResponseType.php | 2 +- .../Specification/Format/OpenAPI3.php | 2 +- .../Specification/Format/Swagger2.php | 2 +- 12 files changed, 66 insertions(+), 81 deletions(-) delete mode 100644 src/Appwrite/SDK/Multiplex.php diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 124de445c3..e0f441ed64 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -9,7 +9,6 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\Multiplex; use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; @@ -3118,22 +3117,22 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ] ), new Method( - namespace: 'databases', - name: 'createDocuments', - description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, - ) - ], - responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - parameters: [ - 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], - ] + namespace: 'databases', + name: 'createDocuments', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + ] ) ] ) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index d0d433410b..1036890a00 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -348,6 +348,10 @@ App::init() */ $method = $route->getLabel('sdk', false); + if (is_array($method)) { + $method = $method[0]; + } + if (!empty($method)) { $namespace = $method->getNamespace(); if ( diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 44a85d2d27..cbef55ef8d 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -109,7 +109,7 @@ class Schema if (is_array($sdk)) { $mainSdk = array_shift($sdk); $additionalMethods = $sdk; - + $sdk = $mainSdk; } diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 35cc9e28cc..4bad3e968f 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -86,17 +86,38 @@ class Mapper } } - /** @var \Appwrite\SDK\Method $sdk */ $sdk = $route->getLabel('sdk', false); if (!$sdk) { return; } - $names = $sdk->getResponseModel() ?? []; - $models = \is_array($names) - ? \array_map(static fn ($m) => static::$models[$m], $names) - : [static::$models[$names]]; + if (is_array($sdk)) { + $sdk = $sdk[0]; + } + + /** @var \Appwrite\SDK\Method $sdk */ + $responses = $sdk->getResponses() ?? []; + + // If responses is an array, map each response to its model + if (\is_array($responses)) { + $models = []; + foreach ($responses as $response) { + $modelName = $response->getModel(); + + if (\is_array($modelName)) { + foreach ($modelName as $name) { + $models[] = static::$models[$name]; + } + } else { + $models[] = static::$models[$modelName]; + } + } + } else { + // If single response, get its model and wrap in array + $modelName = $responses->getModel(); + $models = [static::$models[$modelName]]; + } foreach ($models as $model) { $type = Mapper::model(\ucfirst($model->getType())); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 627ac8c912..02a60b81e9 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -200,10 +200,10 @@ class Specs extends Action if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { continue; } - + $routeSecurity = $sdk->getAuth(); $sdkPlatforms = []; - + foreach ($routeSecurity as $value) { switch ($value) { case AuthType::SESSION: @@ -218,32 +218,32 @@ class Specs extends Action break; } } - + if (empty($routeSecurity)) { $sdkPlatforms[] = APP_PLATFORM_SERVER; $sdkPlatforms[] = APP_PLATFORM_CLIENT; } - + if (!$route->getLabel('docs', true)) { continue; } - + if ($route->getLabel('mock', false) && !$mocks) { continue; } - + if (!$route->getLabel('mock', false) && $mocks) { continue; } - + if (empty($sdk->getNamespace())) { continue; } - + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { continue; } - + $routes[] = $route; } } diff --git a/src/Appwrite/SDK/AuthType.php b/src/Appwrite/SDK/AuthType.php index e2ae5ead4d..307b3cf35e 100644 --- a/src/Appwrite/SDK/AuthType.php +++ b/src/Appwrite/SDK/AuthType.php @@ -8,4 +8,4 @@ enum AuthType: string case KEY = APP_AUTH_TYPE_KEY; case SESSION = APP_AUTH_TYPE_SESSION; case ADMIN = APP_AUTH_TYPE_ADMIN; -} \ No newline at end of file +} diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 8a8bd8c9d1..6a809662d2 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -2,8 +2,8 @@ namespace Appwrite\SDK; -use Appwrite\Utopia\Response; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; use Swoole\Http\Response as HttpResponse; class Method @@ -20,8 +20,6 @@ class Method * @param string $description * @param array $auth * @param array $responses - * @param int $responseCode - * @param string|array $responseModel * @param ResponseType $responseType * @param MethodType|null $methodType * @param string|null $offlineKey @@ -155,6 +153,9 @@ class Method return $this->auth; } + /** + * @return Array + */ public function getResponses(): array { return $this->responses; @@ -211,7 +212,7 @@ class Method } // Throw any errors that were found during initialization - static function finaliseInitialization(): void + public static function finaliseInitialization(): void { if (!empty(self::$errors)) { throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); diff --git a/src/Appwrite/SDK/MethodType.php b/src/Appwrite/SDK/MethodType.php index b4982c847a..2b1f786779 100644 --- a/src/Appwrite/SDK/MethodType.php +++ b/src/Appwrite/SDK/MethodType.php @@ -8,4 +8,4 @@ enum MethodType: string case LOCATION = 'location'; case GRAPHQL = 'graphql'; case UPLOAD = 'upload'; -} \ No newline at end of file +} diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php deleted file mode 100644 index 4129169528..0000000000 --- a/src/Appwrite/SDK/Multiplex.php +++ /dev/null @@ -1,40 +0,0 @@ - $parameters - * @param array $required - * @param string $responseModel - */ - public function __construct( - private string $name, - private array $parameters, - private array $required, - private string $responseModel - ) { - } - - public function getName(): string - { - return $this->name; - } - - public function getParameters(): array - { - return $this->parameters; - } - - public function getRequired(): array - { - return $this->required; - } - - public function getResponseModel(): string - { - return $this->responseModel; - } -} diff --git a/src/Appwrite/SDK/ResponseType.php b/src/Appwrite/SDK/ResponseType.php index e2f5d32e5e..8d34fb1a90 100644 --- a/src/Appwrite/SDK/ResponseType.php +++ b/src/Appwrite/SDK/ResponseType.php @@ -12,4 +12,4 @@ enum ResponseType: string case HTML = 'text/html'; case TEXT = 'text/plain'; case ANY = '*/*'; -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index c1ab9a8250..9abf94e6c2 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -214,7 +214,7 @@ class OpenAPI3 extends Format 'required' => [], 'responses' => [] ]; - + foreach ($method->getParameters() as $name => $param) { $additionalMethod['parameters'][] = $name; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 34f6c99b37..59e5b96106 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -215,7 +215,7 @@ class Swagger2 extends Format 'required' => [], 'responses' => [] ]; - + foreach ($method->getParameters() as $name => $param) { $additionalMethod['parameters'][] = $name; From 8f2cca5b0f80ec8cf5e4780d46c29d21ff1a40ed Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 16:53:09 +0900 Subject: [PATCH 074/161] Fix Response Models --- app/controllers/api/users.php | 7 --- app/controllers/general.php | 29 ++++++++- docs/tutorials/add-route.md | 20 ++++--- src/Appwrite/SDK/Method.php | 98 +++++++++++++++++++++++++++++++ src/Appwrite/Utopia/Request.php | 10 +++- tests/unit/Utopia/RequestTest.php | 10 +++- 6 files changed, 154 insertions(+), 20 deletions(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index b80bce1a2b..c9fc6a5cd0 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -188,13 +188,6 @@ App::post('/v1/users') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/users/create-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) ->label('sdk', new Method( namespace: 'users', name: 'create', diff --git a/app/controllers/general.php b/app/controllers/general.php index 663242882a..4cee363317 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -10,6 +10,10 @@ use Appwrite\Event\Func; use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -93,8 +97,29 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $type = $route->getAttribute('resourceType'); if ($type === 'function') { - $utopia->getRoute()?->label('sdk.namespace', 'functions'); - $utopia->getRoute()?->label('sdk.method', 'createExecution'); + $method = $utopia->getRoute()?->getLabel('sdk', null); + + if (empty($method)) { + $utopia->getRoute()?->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], + responseType: ResponseType::MULTIPART, + requestType: 'application/json', + )); + } else { + /** @var Method $method */ + $method->setNamespace('functions'); + $method->setMethodName('createExecution'); + $utopia->getRoute()?->label('sdk', $method); + } if (System::getEnv('_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS if ($request->getProtocol() !== 'https') { diff --git a/docs/tutorials/add-route.md b/docs/tutorials/add-route.md index ac6fd40bdb..53926f7002 100644 --- a/docs/tutorials/add-route.md +++ b/docs/tutorials/add-route.md @@ -85,13 +85,19 @@ App::post('/v1/account/create') ```php App::post('/v1/account/jwt') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/account/create-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'account', + name: 'createJWT', + description: '/docs/references/account/create-jwt.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ], + responseType: ResponseType::JSON, + )) ``` #### Cache diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 6a809662d2..5032c6df53 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -211,6 +211,104 @@ class Method return $this->parameters; } + public function setNamespace(string $namespace): self + { + $this->namespace = $namespace; + return $this; + } + + public function setMethodName(string $name): self + { + $this->name = $name; + return $this; + } + + public function setDescription(string $description): self + { + $this->description = $description; + return $this; + } + + public function setAuth(array $auth): self + { + $this->validateAuthTypes($auth); + $this->auth = $auth; + return $this; + } + + /** + * @param Array $responses + */ + public function setResponses(array $responses): self + { + foreach ($responses as $response) { + $this->validateResponseModel($response->getModel()); + $this->validateNoContent($response); + } + $this->responses = $responses; + return $this; + } + + public function setResponseType(ResponseType $responseType): self + { + $this->responseType = $responseType; + return $this; + } + + public function setMethodType(?MethodType $methodType): self + { + $this->methodType = $methodType; + return $this; + } + + public function setOfflineKey(?string $offlineKey): self + { + $this->offlineKey = $offlineKey; + return $this; + } + + public function setOfflineModel(?string $offlineModel): self + { + $this->offlineModel = $offlineModel; + return $this; + } + + public function setOfflineResponseKey(?string $offlineResponseKey): self + { + $this->offlineResponseKey = $offlineResponseKey; + return $this; + } + + public function setDeprecated(bool $deprecated): self + { + $this->deprecated = $deprecated; + return $this; + } + + public function setHide(bool|array $hide): self + { + $this->hide = $hide; + return $this; + } + + public function setPackaging(bool $packaging): self + { + $this->packaging = $packaging; + return $this; + } + + public function setRequestType(string $requestType): self + { + $this->requestType = $requestType; + return $this; + } + + public function setParameters(array $parameters): self + { + $this->parameters = $parameters; + return $this; + } + // Throw any errors that were found during initialization public static function finaliseInitialization(): void { diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index 26c1baf188..a4fc0e0f63 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -28,8 +28,14 @@ class Request extends UtopiaRequest $parameters = parent::getParams(); if ($this->hasFilters() && self::hasRoute()) { - $method = self::getRoute()->getLabel('sdk.method', 'unknown'); - $endpointIdentifier = self::getRoute()->getLabel('sdk.namespace', 'unknown') . '.' . $method; + $method = self::getRoute()->getLabel('sdk', null); + /** @var \Appwrite\SDK\Method $method */ + + if (empty($method)) { + $endpointIdentifier = 'unknown.unknown'; + } else { + $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + } foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); diff --git a/tests/unit/Utopia/RequestTest.php b/tests/unit/Utopia/RequestTest.php index 73daaa88bc..e19fdbe01f 100644 --- a/tests/unit/Utopia/RequestTest.php +++ b/tests/unit/Utopia/RequestTest.php @@ -2,6 +2,7 @@ namespace Tests\Unit\Utopia; +use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use PHPUnit\Framework\TestCase; use Swoole\Http\Request as SwooleRequest; @@ -31,8 +32,13 @@ class RequestTest extends TestCase $this->assertCount(2, $this->request->getFilters()); $route = new Route(Request::METHOD_GET, '/test'); - $route->label('sdk.method', 'method'); - $route->label('sdk.namespace', 'namespace'); + $route->label('sdk', new Method( + namespace: 'namespace', + name: 'method', + description: 'description', + auth: [], + responses: [], + )); // set test header to prevent header populaten inside the request class $this->request->addHeader('EXAMPLE', 'VALUE'); $this->request->setRoute($route); From d54d0ea7b3b93854b3fec7880ee134db80129ca5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 13 Jan 2025 09:35:05 +0900 Subject: [PATCH 075/161] Address error validation comment --- app/http.php | 6 +++++- src/Appwrite/SDK/Method.php | 7 ++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/http.php b/app/http.php index 42a9010482..1ef4dcd282 100644 --- a/app/http.php +++ b/app/http.php @@ -336,5 +336,9 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); -Method::finaliseInitialization(); +// Check for any errors found while we were initialising the SDK Methods. +if (!empty(Method::getErrors())) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); +} + $http->start(); diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 5032c6df53..ffcafb984b 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -309,11 +309,8 @@ class Method return $this; } - // Throw any errors that were found during initialization - public static function finaliseInitialization(): void + public static function getErrors(): array { - if (!empty(self::$errors)) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); - } + return self::$errors; } } From efd8dc16b342b4d80a90b3336574724df1590df7 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 17:52:31 +0900 Subject: [PATCH 076/161] Address Comments --- app/config/specs/swagger2-latest-client.json | 18 +++++++----------- app/config/specs/swagger2-latest-console.json | 18 +++++++----------- app/config/specs/swagger2-latest-server.json | 18 +++++++----------- app/controllers/api/databases.php | 8 ++++---- app/controllers/api/graphql.php | 4 ++-- src/Appwrite/SDK/Method.php | 9 ++++++++- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 7 files changed, 36 insertions(+), 41 deletions(-) diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 65e28ff79d..80f3eb574f 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4806,14 +4806,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -4827,18 +4827,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 5ac694787c..aace6f890d 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8390,14 +8390,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -8411,18 +8411,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 64544d2a03..6db78641e8 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7904,14 +7904,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -7925,18 +7925,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e0f441ed64..f6054ee37b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3111,9 +3111,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ - 'documentId' => ['default' => [], 'validator' => new CustomId(), 'description' => '', 'optional' => false], - 'data' => ['default' => [], 'validator' => new JSON(), 'description' => '', 'optional' => false], - 'permissions' => ['default' => [], 'validator' => new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'description' => '', 'optional' => true], + 'documentId' => ['optional' => false], + 'data' => ['optional' => false], + 'permissions' => ['optional' => true], ] ), new Method( @@ -3131,7 +3131,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ - 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + 'documents' => ['optional' => false], ] ) ] diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 1f4e4e334a..62a7c72d61 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -100,7 +100,7 @@ App::post('/v1/graphql/mutation') ) ], methodType: MethodType::GRAPHQL, - parameters: [ + additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], )) @@ -150,7 +150,7 @@ App::post('/v1/graphql') ) ], methodType: MethodType::GRAPHQL, - parameters: [ + additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], )) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index ffcafb984b..34ac15328c 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -30,6 +30,7 @@ class Method * @param bool $packaging * @param string $requestType * @param array $parameters + * @param array $additionalParameters * * @throws \Exception */ @@ -48,7 +49,8 @@ class Method protected array|bool $hide = false, protected bool $packaging = false, protected string $requestType = 'application/json', - protected array $parameters = [] + protected array $parameters = [], + protected array $additionalParameters = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); @@ -211,6 +213,11 @@ class Method return $this->parameters; } + public function getAdditionalParameters(): array + { + return $this->additionalParameters; + } + public function setNamespace(string $namespace): self { $this->namespace = $namespace; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 59e5b96106..461feb844c 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -330,7 +330,7 @@ class Swagger2 extends Format $parameters = \array_merge( $route->getParams(), - $sdk->getParameters() ?? [], + $sdk->getAdditionalParameters() ?? [], ); foreach ($parameters as $name => $param) { // Set params From ec44b1f272fbd2c97ae989af3bf23de07d0e42c1 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 18:09:37 +0900 Subject: [PATCH 077/161] Make all delete routes return none --- app/config/specs/open-api3-latest-client.json | 2 +- .../specs/open-api3-latest-console.json | 8 +- app/config/specs/open-api3-latest-server.json | 4 +- app/config/specs/swagger2-latest-client.json | 44 ++--- app/config/specs/swagger2-latest-console.json | 160 +++++------------- app/config/specs/swagger2-latest-server.json | 112 +++--------- app/controllers/api/account.php | 13 +- app/controllers/api/databases.php | 12 +- app/controllers/api/functions.php | 12 +- app/controllers/api/messaging.php | 13 +- app/controllers/api/migrations.php | 4 +- app/controllers/api/project.php | 4 +- app/controllers/api/projects.php | 19 ++- app/controllers/api/proxy.php | 4 +- app/controllers/api/storage.php | 6 +- app/controllers/api/teams.php | 7 +- app/controllers/api/users.php | 19 ++- app/controllers/api/vcs.php | 3 +- 18 files changed, 162 insertions(+), 284 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 9164bb0a7f..9fa6b2250d 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4770,7 +4770,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 484b25e18e..f69352220a 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8339,7 +8339,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -23551,7 +23551,7 @@ "200": { "description": "EmailTemplate", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/emailTemplate" } @@ -24244,7 +24244,7 @@ "200": { "description": "SmsTemplate", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/smsTemplate" } @@ -29480,7 +29480,7 @@ "200": { "description": "User", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/user" } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 0656264d09..b424630cbc 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7877,7 +7877,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -21141,7 +21141,7 @@ "200": { "description": "User", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/user" } diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 80f3eb574f..b414baf7a5 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -367,9 +367,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -780,9 +778,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1815,9 +1811,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2501,9 +2495,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2783,9 +2775,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -4950,9 +4940,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5238,9 +5226,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -6289,9 +6275,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -6708,9 +6692,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -7445,9 +7427,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -7875,9 +7855,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index aace6f890d..bc1450a9db 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -225,9 +225,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -423,9 +421,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -831,9 +827,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1852,9 +1846,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2535,9 +2527,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2813,9 +2803,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -5161,9 +5149,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5589,9 +5575,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8035,9 +8019,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8534,9 +8516,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8822,9 +8802,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -9270,9 +9248,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -10670,9 +10646,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -11044,9 +11018,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -11615,9 +11587,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -12076,9 +12046,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -15189,9 +15157,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17804,9 +17770,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18332,9 +18296,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18714,9 +18676,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -20057,9 +20017,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "migrations" ], @@ -20475,9 +20433,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "project" ], @@ -20951,9 +20907,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -22435,9 +22389,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -22999,9 +22951,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -24086,9 +24036,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -24766,9 +24714,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -25365,9 +25311,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -25726,9 +25670,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "proxy" ], @@ -26263,9 +26205,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -26670,9 +26610,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -27563,9 +27501,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -28067,9 +28003,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -28812,9 +28746,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -29549,9 +29481,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30077,9 +30007,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30908,9 +30836,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30968,9 +30894,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -31473,9 +31397,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -32468,9 +32390,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "vcs" ], diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6db78641e8..29030aef75 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -385,9 +385,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -803,9 +801,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1852,9 +1848,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2406,9 +2400,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -4642,9 +4634,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5075,9 +5065,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -7543,9 +7531,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8050,9 +8036,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8344,9 +8328,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8707,9 +8689,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -9552,9 +9532,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -9931,9 +9909,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -10512,9 +10488,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -10896,9 +10870,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -14061,9 +14033,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16701,9 +16671,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17236,9 +17204,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17624,9 +17590,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18118,9 +18082,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -18534,9 +18496,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -19287,9 +19247,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -19727,9 +19685,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -20485,9 +20441,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -21155,9 +21109,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -21690,9 +21642,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22533,9 +22483,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22594,9 +22542,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -23105,9 +23051,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 283cf2d8ea..cab34858e3 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -469,7 +469,7 @@ App::delete('/v1/account') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->inject('user') ->inject('project') @@ -571,7 +571,7 @@ App::delete('/v1/account/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->label('abuse-limit', 100) ->inject('request') @@ -695,7 +695,7 @@ App::delete('/v1/account/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') @@ -2008,6 +2008,7 @@ App::post('/v1/account/tokens/magic-url') $senderEmail = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); $senderName = System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'); + $replyTo = ""; if ($smtpEnabled) { @@ -4230,7 +4231,7 @@ App::delete('/v1/account/mfa/authenticators/:type') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4706,7 +4707,7 @@ App::delete('/v1/account/targets/:targetId/push') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4828,7 +4829,7 @@ App::delete('/v1/account/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f6054ee37b..7497e93780 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -785,7 +785,7 @@ App::delete('/v1/databases/:databaseId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -1204,7 +1204,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -2604,7 +2604,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3030,7 +3030,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4192,7 +4192,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) @@ -4317,7 +4317,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8d79ecd40e..8c125e5c13 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1188,7 +1188,8 @@ App::delete('/v1/functions/:functionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1605,7 +1606,8 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -2404,7 +2406,8 @@ App::delete('/v1/functions/:functionId/executions/:executionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2700,7 +2703,8 @@ App::delete('/v1/functions/:functionId/variables/:variableId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 44e77c953d..7a1bbc5994 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -14,6 +14,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -2050,7 +2051,8 @@ App::delete('/v1/messaging/providers/:providerId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2378,7 +2380,8 @@ App::delete('/v1/messaging/topics/:topicId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2751,7 +2754,8 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -4152,7 +4156,8 @@ App::delete('/v1/messaging/messages/:messageId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index e41c23da69..71156df789 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -10,6 +10,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -1143,7 +1144,8 @@ App::delete('/v1/migrations/:migrationId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 3356497a13..0ad69ab1ec 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -4,6 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -501,7 +502,8 @@ App::delete('/v1/project/variables/:variableId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index c1251ecd8b..451e732306 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -13,6 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -1083,7 +1084,8 @@ App::delete('/v1/projects/:projectId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1377,7 +1379,8 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1609,7 +1612,8 @@ App::delete('/v1/projects/:projectId/keys/:keyId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1885,7 +1889,8 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -2300,7 +2305,8 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_SMS_TEMPLATE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2349,7 +2355,8 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_EMAIL_TEMPLATE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 2476bfdaba..e3917acc02 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -8,6 +8,7 @@ use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -279,7 +280,8 @@ App::delete('/v1/proxy/rules/:ruleId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 59e831f057..b2a3f23dfb 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -339,7 +339,8 @@ App::delete('/v1/storage/buckets/:bucketId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -1672,7 +1673,8 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index f364e4d871..67b297bd87 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -14,6 +14,7 @@ use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -382,7 +383,8 @@ App::delete('/v1/teams/:teamId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -1221,7 +1223,8 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index c9fc6a5cd0..04d8952d3a 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -18,6 +18,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -1905,7 +1906,8 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') code: Response::STATUS_CODE_OK, model: Response::MODEL_USER, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -2087,7 +2089,8 @@ App::delete('/v1/users/:userId/sessions/:sessionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2136,7 +2139,8 @@ App::delete('/v1/users/:userId/sessions') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2184,7 +2188,8 @@ App::delete('/v1/users/:userId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2232,7 +2237,8 @@ App::delete('/v1/users/:userId/targets/:targetId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2288,7 +2294,8 @@ App::delete('/v1/users/identities/:identityId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 3e31908bf9..2c4424a348 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -1191,7 +1191,8 @@ App::delete('/v1/vcs/installations/:installationId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') From bc85d04bbc8713b9a93c4a1dfc901e96e1a7d69c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 18:10:27 +0900 Subject: [PATCH 078/161] Run Linter --- app/controllers/api/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 04d8952d3a..64b7f5dbc8 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -2294,7 +2294,7 @@ App::delete('/v1/users/identities/:identityId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ], + ], responseType: ResponseType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') From 396602d8871989e355fe31093b3c9b5b72d6c942 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 09:58:57 +0900 Subject: [PATCH 079/161] Address Comments --- app/controllers/api/account.php | 64 +++++-------------- app/controllers/api/databases.php | 28 ++------ app/controllers/api/locale.php | 32 +++------- app/controllers/api/teams.php | 24 ++----- docker-compose.yml | 2 +- src/Appwrite/SDK/Method.php | 39 ----------- .../Specification/Format/OpenAPI3.php | 5 +- .../Specification/Format/Swagger2.php | 5 +- 8 files changed, 41 insertions(+), 158 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index cab34858e3..8e29b02518 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -438,9 +438,7 @@ App::get('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -522,7 +520,6 @@ App::get('/v1/account/sessions') ) ], responseType: ResponseType::JSON, - offlineModel: '/account/sessions' )) ->inject('response') ->inject('user') @@ -640,9 +637,7 @@ App::get('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/sessions', - offlineKey: '{sessionId}' + responseType: ResponseType::JSON )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') @@ -2652,9 +2647,7 @@ App::get('/v1/account/prefs') model: Response::MODEL_PREFERENCES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/prefs', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -2754,9 +2747,7 @@ App::patch('/v1/account/name') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -2794,9 +2785,7 @@ App::patch('/v1/account/password') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -2869,9 +2858,7 @@ App::patch('/v1/account/email') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -2967,9 +2954,7 @@ App::patch('/v1/account/phone') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -3054,9 +3039,7 @@ App::patch('/v1/account/prefs') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/prefs', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') @@ -3854,9 +3837,7 @@ App::patch('/v1/account/mfa') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') @@ -3909,9 +3890,7 @@ App::get('/v1/account/mfa/factors') model: Response::MODEL_MFA_FACTORS, ) ], - responseType: ResponseType::JSON, - offlineKey: 'current', - offlineModel: '/account' + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -3951,9 +3930,7 @@ App::post('/v1/account/mfa/authenticators/:type') model: Response::MODEL_MFA_TYPE, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') @@ -4029,9 +4006,7 @@ App::put('/v1/account/mfa/authenticators/:type') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') @@ -4100,9 +4075,7 @@ App::post('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -4148,9 +4121,7 @@ App::patch('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('dbForProject') ->inject('response') @@ -4191,9 +4162,7 @@ App::get('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -4757,8 +4726,7 @@ App::get('/v1/account/identities') model: Response::MODEL_IDENTITY_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/identities', + responseType: ResponseType::JSON )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 7497e93780..825b4601e9 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3108,8 +3108,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ) ], responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ 'documentId' => ['optional' => false], 'data' => ['optional' => false], @@ -3124,12 +3122,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, + model: Response::MODEL_DOCUMENT_LIST, ) ], responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ 'documents' => ['optional' => false], ] @@ -3429,8 +3425,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3590,9 +3585,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3806,9 +3799,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4049,8 +4040,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4192,9 +4182,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4317,9 +4305,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::NONE, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 28defca386..5b4c1ac47f 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -25,9 +25,7 @@ App::get('/v1/locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_LOCALE, ) - ], - offlineKey: 'current', - offlineModel: '/localed', + ] )) ->inject('request') ->inject('response') @@ -90,9 +88,7 @@ App::get('/v1/locale/codes') code: Response::STATUS_CODE_OK, model: Response::MODEL_LOCALE_CODE_LIST, ) - ], - offlineKey: 'current', - offlineModel: '/locale/localeCode', + ] )) ->inject('response') ->action(function (Response $response) { @@ -117,9 +113,7 @@ App::get('/v1/locale/countries') code: Response::STATUS_CODE_OK, model: Response::MODEL_COUNTRY_LIST, ) - ], - offlineModel: '/locale/countries', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -155,9 +149,7 @@ App::get('/v1/locale/countries/eu') code: Response::STATUS_CODE_OK, model: Response::MODEL_COUNTRY_LIST, ) - ], - offlineModel: '/locale/countries/eu', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -195,9 +187,7 @@ App::get('/v1/locale/countries/phones') code: Response::STATUS_CODE_OK, model: Response::MODEL_PHONE_LIST, ) - ], - offlineModel: '/locale/countries/phones', - offlineResponseKey: 'countryCode' + ] )) ->inject('response') ->inject('locale') @@ -234,9 +224,7 @@ App::get('/v1/locale/continents') code: Response::STATUS_CODE_OK, model: Response::MODEL_CONTINENT_LIST, ) - ], - offlineModel: '/locale/continents', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -271,9 +259,7 @@ App::get('/v1/locale/currencies') code: Response::STATUS_CODE_OK, model: Response::MODEL_CURRENCY_LIST, ) - ], - offlineModel: '/locale/currencies', - offlineResponseKey: 'code' + ] )) ->inject('response') ->action(function (Response $response) { @@ -299,9 +285,7 @@ App::get('/v1/locale/languages') code: Response::STATUS_CODE_OK, model: Response::MODEL_LANGUAGE_LIST, ) - ], - offlineModel: '/locale/languages', - offlineResponseKey: 'code' + ] )) ->inject('response') ->action(function (Response $response) { diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 67b297bd87..2cc88e11a7 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -157,8 +157,7 @@ App::get('/v1/teams') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM_LIST, ) - ], - offlineModel: '/teams', + ] )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -226,9 +225,7 @@ App::get('/v1/teams/:teamId') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM, ) - ], - offlineModel: '/teams', - offlineKey: '{teamId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -258,8 +255,7 @@ App::get('/v1/teams/:teamId/prefs') code: Response::STATUS_CODE_OK, model: Response::MODEL_PREFERENCES, ) - ], - offlineModel: '/teams/{teamId}/prefs', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -294,9 +290,7 @@ App::put('/v1/teams/:teamId') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM, ) - ], - offlineModel: '/teams', - offlineKey: '{teamId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('name', null, new Text(128), 'New team name. Max length: 128 chars.') @@ -343,8 +337,7 @@ App::put('/v1/teams/:teamId/prefs') code: Response::STATUS_CODE_OK, model: Response::MODEL_PREFERENCES, ) - ], - offlineModel: '/teams/{teamId}/prefs', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') @@ -771,8 +764,7 @@ App::get('/v1/teams/:teamId/memberships') code: Response::STATUS_CODE_OK, model: Response::MODEL_MEMBERSHIP_LIST, ) - ], - offlineModel: '/teams/{teamId}/memberships', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true) @@ -907,9 +899,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') code: Response::STATUS_CODE_OK, model: Response::MODEL_MEMBERSHIP, ) - ], - offlineModel: '/teams/{teamId}/memberships', - offlineKey: '{membershipId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/docker-compose.yml b/docker-compose.yml index 048178e60a..e104cfcbec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,7 +49,7 @@ services: build: context: . args: - DEBUG: false + DEBUG: true TESTING: true VERSION: dev ports: diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 34ac15328c..c1c4a3e6e2 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -22,9 +22,6 @@ class Method * @param array $responses * @param ResponseType $responseType * @param MethodType|null $methodType - * @param string|null $offlineKey - * @param string|null $offlineModel - * @param string|null $offlineResponseKey * @param bool $deprecated * @param array|bool $hide * @param bool $packaging @@ -42,9 +39,6 @@ class Method protected array $responses, protected ResponseType $responseType = ResponseType::JSON, protected ?MethodType $methodType = null, - protected ?string $offlineKey = null, - protected ?string $offlineModel = null, - protected ?string $offlineResponseKey = null, protected bool $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, @@ -173,21 +167,6 @@ class Method return $this->methodType; } - public function getOfflineKey(): ?string - { - return $this->offlineKey; - } - - public function getOfflineModel(): ?string - { - return $this->offlineModel; - } - - public function getOfflineResponseKey(): ?string - { - return $this->offlineResponseKey; - } - public function isDeprecated(): bool { return $this->deprecated; @@ -268,24 +247,6 @@ class Method return $this; } - public function setOfflineKey(?string $offlineKey): self - { - $this->offlineKey = $offlineKey; - return $this; - } - - public function setOfflineModel(?string $offlineModel): self - { - $this->offlineModel = $offlineModel; - return $this; - } - - public function setOfflineResponseKey(?string $offlineResponseKey): self - { - $this->offlineResponseKey = $offlineResponseKey; - return $this; - } - public function setDeprecated(bool $deprecated): self { $this->deprecated = $deprecated; diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 9abf94e6c2..3c8df24e48 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -196,10 +196,7 @@ class OpenAPI3 extends Format 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $sdk->isPackaging(), - 'offline-model' => $sdk->getOfflineModel() ?? '', - 'offline-key' => $sdk->getOfflineKey() ?? '', - 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', + 'packaging' => $sdk->isPackaging() ], ]; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 461feb844c..d07d64d66a 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -194,10 +194,7 @@ class Swagger2 extends Format 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $sdk->isPackaging(), - 'offline-model' => $sdk->getOfflineModel() ?? '', - 'offline-key' => $sdk->getOfflineKey() ?? '', - 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', + 'packaging' => $sdk->isPackaging() ], ]; From 8d7712a669d63c035f8c9933d1d4a750d93b177c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 09:59:16 +0900 Subject: [PATCH 080/161] Remove debug flag --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e104cfcbec..048178e60a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,7 +49,7 @@ services: build: context: . args: - DEBUG: true + DEBUG: false TESTING: true VERSION: dev ports: From d6474a85e296c741e0770f4eeb2c232a4f81bf88 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 12:54:49 +0900 Subject: [PATCH 081/161] Address Comments --- app/config/specs/open-api3-latest-client.json | 296 +---- .../specs/open-api3-latest-console.json | 1127 +--------------- app/config/specs/open-api3-latest-server.json | 811 +----------- app/config/specs/swagger2-latest-client.json | 301 +---- app/config/specs/swagger2-latest-console.json | 1132 +---------------- app/config/specs/swagger2-latest-server.json | 812 +----------- app/controllers/api/account.php | 102 +- app/controllers/api/avatars.php | 30 +- app/controllers/api/console.php | 6 +- app/controllers/api/databases.php | 80 +- app/controllers/api/functions.php | 18 +- app/controllers/api/graphql.php | 4 +- app/controllers/api/health.php | 48 +- app/controllers/api/messaging.php | 10 +- app/controllers/api/migrations.php | 6 +- app/controllers/api/project.php | 4 +- app/controllers/api/projects.php | 14 +- app/controllers/api/proxy.php | 4 +- app/controllers/api/storage.php | 20 +- app/controllers/api/teams.php | 6 +- app/controllers/api/users.php | 18 +- app/controllers/api/vcs.php | 8 +- app/controllers/general.php | 4 +- .../SDK/{ResponseType.php => ContentType.php} | 2 +- src/Appwrite/SDK/Method.php | 22 +- src/Appwrite/SDK/Response.php | 8 +- .../Specification/Format/OpenAPI3.php | 7 +- .../Specification/Format/Swagger2.php | 10 +- 28 files changed, 252 insertions(+), 4658 deletions(-) rename src/Appwrite/SDK/{ResponseType.php => ContentType.php} (91%) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 9fa6b2250d..985e6e104b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -109,9 +106,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -196,9 +190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -274,9 +265,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -335,9 +323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -400,9 +385,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -451,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -519,9 +498,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -591,9 +567,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -659,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -739,9 +709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -809,9 +776,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -885,9 +849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -963,9 +924,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1016,9 +974,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1067,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1118,9 +1070,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1171,9 +1120,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1243,9 +1189,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1320,9 +1263,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1398,9 +1338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1449,9 +1386,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1524,9 +1458,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1600,9 +1531,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1684,9 +1612,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1728,9 +1653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1781,9 +1703,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1832,9 +1751,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1908,9 +1824,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1977,9 +1890,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2120,9 +2030,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2196,9 +2103,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2272,9 +2176,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2335,9 +2236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2391,9 +2289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2456,9 +2351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2508,9 +2400,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2589,9 +2478,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2662,9 +2548,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2726,9 +2609,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2810,9 +2690,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2889,9 +2766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3035,9 +2909,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3111,9 +2982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3181,9 +3049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3262,9 +3127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3313,9 +3175,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3385,9 +3244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3513,9 +3369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3645,9 +3498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3705,9 +3555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4195,9 +4042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4279,9 +4123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4373,9 +4214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4474,9 +4312,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4561,9 +4396,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -4576,8 +4408,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -4690,9 +4521,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4770,7 +4598,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -4796,9 +4624,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4891,9 +4716,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4988,9 +4810,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5089,9 +4908,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5175,9 +4991,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5263,9 +5076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5380,9 +5190,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5456,9 +5263,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5510,9 +5314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5564,9 +5365,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5618,9 +5416,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5672,9 +5467,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5726,9 +5518,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5780,9 +5569,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5834,9 +5620,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5888,9 +5671,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5942,9 +5722,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5997,9 +5774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6082,9 +5856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6158,9 +5929,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6246,9 +6014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6346,9 +6111,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6420,9 +6182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6511,9 +6270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6580,9 +6336,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6649,9 +6402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6867,9 +6617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6943,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7021,9 +6765,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7108,9 +6849,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7172,9 +6910,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7248,9 +6983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7314,9 +7046,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7402,9 +7131,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7515,9 +7241,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7589,9 +7312,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7678,9 +7398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7753,9 +7470,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7853,9 +7567,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7916,9 +7627,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index f69352220a..98699ace10 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -108,9 +105,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -185,9 +179,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -236,9 +227,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -313,9 +301,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -373,9 +358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -437,9 +419,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -488,9 +467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -555,9 +531,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -626,9 +599,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -693,9 +663,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -772,9 +739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -841,9 +805,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -917,9 +878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -994,9 +952,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1046,9 +1001,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1096,9 +1048,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1146,9 +1095,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1198,9 +1144,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1269,9 +1212,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1345,9 +1285,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1422,9 +1359,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1472,9 +1406,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1546,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1621,9 +1549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1704,9 +1629,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1747,9 +1669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1799,9 +1718,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1850,9 +1766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1926,9 +1839,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1995,9 +1905,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2138,9 +2045,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2214,9 +2118,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2290,9 +2191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2352,9 +2250,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2407,9 +2302,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2471,9 +2363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2522,9 +2411,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2602,9 +2488,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2674,9 +2557,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2737,9 +2617,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2821,9 +2698,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2900,9 +2774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3046,9 +2917,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3122,9 +2990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3191,9 +3056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3271,9 +3133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3321,9 +3180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3392,9 +3248,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3520,9 +3373,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3652,9 +3502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3712,9 +3559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4202,9 +4046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4286,9 +4127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4380,9 +4218,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4472,9 +4307,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4541,9 +4373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4591,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4666,9 +4492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4747,9 +4570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4821,9 +4641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4882,9 +4699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4960,9 +4774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5023,9 +4834,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5108,9 +4916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5214,9 +5019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5285,9 +5087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5386,9 +5185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5459,9 +5255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5545,9 +5338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5653,9 +5443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5766,9 +5553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5874,9 +5658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5987,9 +5768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6095,9 +5873,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6208,9 +5983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6325,9 +6097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6447,9 +6216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6565,9 +6331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6690,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6808,9 +6568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6933,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7041,9 +6795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7154,9 +6905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7287,9 +7035,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7406,9 +7151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7524,9 +7266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7632,9 +7371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7776,9 +7512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7849,9 +7582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7931,9 +7661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8043,9 +7770,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8130,9 +7854,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -8145,8 +7866,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -8259,9 +7979,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8339,7 +8056,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -8365,9 +8082,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8460,9 +8174,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8557,9 +8268,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8658,9 +8366,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8742,9 +8447,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8837,9 +8539,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8921,9 +8620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9043,9 +8739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9116,9 +8809,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9198,9 +8888,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9283,9 +8970,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9377,9 +9061,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9452,9 +9133,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9536,9 +9214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9611,9 +9286,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9860,9 +9532,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9912,9 +9581,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9963,9 +9629,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10065,9 +9728,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10127,9 +9787,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10201,9 +9858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10262,9 +9916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10488,9 +10139,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10551,9 +10199,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10636,9 +10281,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10734,9 +10376,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10805,9 +10444,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10869,9 +10505,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10935,9 +10568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11022,9 +10652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11089,9 +10716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11165,9 +10789,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11253,9 +10874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11370,9 +10988,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11435,9 +11050,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11508,9 +11120,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11592,9 +11201,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11653,9 +11259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11741,9 +11344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11812,9 +11412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11900,9 +11497,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11975,9 +11569,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12029,9 +11620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12081,9 +11669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12132,9 +11717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12183,9 +11765,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12234,9 +11813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12296,9 +11872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12347,9 +11920,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12398,9 +11968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12449,9 +12016,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12513,9 +12077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12577,9 +12138,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12652,9 +12210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12716,9 +12271,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12806,9 +12358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12870,9 +12419,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12934,9 +12480,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12998,9 +12541,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13062,9 +12602,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13126,9 +12663,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13190,9 +12724,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13254,9 +12785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13318,9 +12846,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13369,9 +12894,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13420,9 +12942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13473,9 +12992,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13527,9 +13043,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13581,9 +13094,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13635,9 +13145,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13689,9 +13196,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13743,9 +13247,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13797,9 +13298,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13851,9 +13349,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13904,9 +13399,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13982,9 +13474,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14128,9 +13617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14276,9 +13762,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14433,9 +13916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14592,9 +14072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14703,9 +14180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14817,9 +14291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14872,9 +14343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14936,9 +14404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15013,9 +14478,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15090,9 +14552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15168,9 +14627,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15275,9 +14731,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15385,9 +14838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15472,9 +14922,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15562,9 +15009,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15679,9 +15123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15799,9 +15240,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15896,9 +15334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15996,9 +15431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16103,9 +15535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16213,9 +15642,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16358,9 +15784,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16505,9 +15928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16602,9 +16022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16702,9 +16119,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16799,9 +16213,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16899,9 +16310,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16996,9 +16404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17096,9 +16501,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17193,9 +16595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17293,9 +16692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17348,9 +16744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17412,9 +16805,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17489,9 +16879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17566,9 +16953,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17642,9 +17026,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17727,9 +17108,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17789,9 +17167,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17868,9 +17243,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17932,9 +17304,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18009,9 +17378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18097,9 +17463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18187,9 +17550,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18254,9 +17614,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18328,9 +17685,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18404,9 +17758,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18494,9 +17845,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18589,9 +17937,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18660,9 +18005,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18710,9 +18052,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18788,9 +18127,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18838,9 +18174,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18912,9 +18245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18986,9 +18316,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19099,9 +18426,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19234,9 +18558,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19341,9 +18662,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19467,9 +18785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19527,9 +18842,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19580,9 +18892,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19642,9 +18951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19732,9 +19038,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19780,9 +19083,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19855,9 +19155,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19915,9 +19212,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19992,9 +19286,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20054,9 +19345,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20128,9 +19416,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20265,9 +19550,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20325,9 +19607,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20442,9 +19721,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20504,9 +19780,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20598,9 +19871,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20679,9 +19949,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20760,9 +20027,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20841,9 +20105,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20922,9 +20183,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21015,9 +20273,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21099,9 +20354,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21180,9 +20432,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21261,9 +20510,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21342,9 +20588,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21423,9 +20666,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21525,9 +20765,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21614,9 +20851,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21674,9 +20908,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21769,9 +21000,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21839,9 +21067,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21935,9 +21160,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22007,9 +21229,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22146,9 +21365,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22206,9 +21422,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22327,9 +21540,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22397,9 +21607,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22494,9 +21701,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22566,9 +21770,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22668,9 +21869,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22749,9 +21947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22869,9 +22064,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23002,9 +22194,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23083,9 +22272,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23309,9 +22495,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23551,7 +22734,7 @@ "200": { "description": "EmailTemplate", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/emailTemplate" } @@ -23575,9 +22758,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23803,9 +22983,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24026,9 +23203,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24244,7 +23418,7 @@ "200": { "description": "SmsTemplate", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/smsTemplate" } @@ -24268,9 +23442,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24493,9 +23664,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24553,9 +23721,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24670,9 +23835,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24740,9 +23902,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24858,9 +24017,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24930,9 +24086,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25002,9 +24155,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25076,9 +24226,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25162,9 +24309,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25215,9 +24359,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25277,9 +24418,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25339,9 +24477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25414,9 +24549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25543,9 +24675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25604,9 +24733,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25730,9 +24856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25795,9 +24918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25883,9 +25003,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25983,9 +25100,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26057,9 +25171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26148,9 +25259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26217,9 +25325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26286,9 +25391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26504,9 +25606,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26578,9 +25677,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26652,9 +25748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26738,9 +25831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26816,9 +25906,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26903,9 +25990,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26967,9 +26051,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27043,9 +26124,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27107,9 +26185,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27184,9 +26259,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27272,9 +26344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27385,9 +26454,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27459,9 +26525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27548,9 +26611,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27623,9 +26683,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27722,9 +26779,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27784,9 +26838,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27866,9 +26917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27941,9 +26989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28031,9 +27076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28118,9 +27160,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28205,9 +27244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28275,9 +27311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28338,9 +27371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28425,9 +27455,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28512,9 +27539,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28629,9 +27653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28734,9 +27755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28841,9 +27859,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28915,9 +27930,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28969,9 +27981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29032,9 +28041,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29114,9 +28120,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29198,9 +28201,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29283,9 +28283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29359,9 +28356,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29422,9 +28416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29477,15 +28468,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -29504,9 +28488,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29582,9 +28563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29645,9 +28623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29706,9 +28681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29767,9 +28739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29830,9 +28799,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29912,9 +28878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29994,9 +28957,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30076,9 +29036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30137,9 +29094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30219,9 +29173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30280,9 +29231,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30334,9 +29282,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30390,9 +29335,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30463,9 +29405,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30546,9 +29485,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30621,9 +29557,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30733,9 +29666,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30805,9 +29735,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30896,9 +29823,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30969,9 +29893,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31053,9 +29974,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31135,9 +30053,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31217,9 +30132,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31288,9 +30200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31375,9 +30284,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31447,9 +30353,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31519,9 +30422,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31602,9 +30502,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31683,9 +30580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31774,9 +30668,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31850,9 +30741,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31903,9 +30791,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index b424630cbc..647b43fc8a 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -110,9 +107,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -197,9 +191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -276,9 +267,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -338,9 +326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -404,9 +389,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -455,9 +437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -524,9 +503,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -597,9 +573,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -666,9 +639,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -747,9 +717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -818,9 +785,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -894,9 +858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -973,9 +934,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1027,9 +985,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1079,9 +1034,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1131,9 +1083,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1185,9 +1134,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1258,9 +1204,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1336,9 +1279,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1415,9 +1355,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1467,9 +1404,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1543,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1620,9 +1551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1705,9 +1633,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1750,9 +1675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1804,9 +1726,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1855,9 +1774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1931,9 +1847,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2007,9 +1920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2083,9 +1993,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2159,9 +2066,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2223,9 +2127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2280,9 +2181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2346,9 +2244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2400,9 +2295,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2484,9 +2376,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2563,9 +2452,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2709,9 +2595,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2785,9 +2668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2856,9 +2736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2938,9 +2815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2990,9 +2864,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3063,9 +2934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3193,9 +3061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3327,9 +3192,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3389,9 +3251,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3881,9 +3740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3967,9 +3823,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4063,9 +3916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4164,9 +4014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4240,9 +4087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4322,9 +4166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4384,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4463,9 +4301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4527,9 +4362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4613,9 +4445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4720,9 +4549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4792,9 +4618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4894,9 +4717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4968,9 +4788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5055,9 +4872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5164,9 +4978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5278,9 +5089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5387,9 +5195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5501,9 +5306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5610,9 +5412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5724,9 +5523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5842,9 +5638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5965,9 +5758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6084,9 +5874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6210,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6329,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6455,9 +6236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6564,9 +6342,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6678,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6812,9 +6584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6932,9 +6701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7051,9 +6817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7160,9 +6923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7305,9 +7065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7379,9 +7136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7462,9 +7216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7575,9 +7326,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7664,9 +7412,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -7679,8 +7424,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -7795,9 +7539,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7877,7 +7618,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -7903,9 +7644,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8000,9 +7738,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8099,9 +7834,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8202,9 +7934,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8288,9 +8017,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8373,9 +8099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8496,9 +8219,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8570,9 +8290,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8653,9 +8370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8729,9 +8443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8979,9 +8690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9032,9 +8740,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9084,9 +8789,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9146,9 +8848,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9373,9 +9072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9437,9 +9133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9523,9 +9216,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9622,9 +9312,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9694,9 +9381,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9759,9 +9443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9826,9 +9507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9914,9 +9592,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9982,9 +9657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10059,9 +9731,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10149,9 +9818,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10268,9 +9934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10335,9 +9998,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10409,9 +10069,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10471,9 +10128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10560,9 +10214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10632,9 +10283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10721,9 +10369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10797,9 +10442,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10853,9 +10495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10907,9 +10546,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10959,9 +10595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11011,9 +10644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11063,9 +10693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11126,9 +10753,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11178,9 +10802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11230,9 +10851,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11282,9 +10900,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11347,9 +10962,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11412,9 +11024,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11488,9 +11097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11553,9 +11159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11644,9 +11247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11709,9 +11309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11774,9 +11371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11839,9 +11433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11904,9 +11495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11969,9 +11557,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12034,9 +11619,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12099,9 +11681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12164,9 +11743,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12216,9 +11792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12268,9 +11841,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12322,9 +11892,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12378,9 +11945,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12434,9 +11998,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12490,9 +12051,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12546,9 +12104,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12602,9 +12157,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12658,9 +12210,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12714,9 +12263,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12769,9 +12315,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12848,9 +12391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12995,9 +12535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13144,9 +12681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13302,9 +12836,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13462,9 +12993,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13574,9 +13102,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13689,9 +13214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13745,9 +13267,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13810,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13888,9 +13404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13966,9 +13479,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14045,9 +13555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14153,9 +13660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14264,9 +13768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14352,9 +13853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14443,9 +13941,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14561,9 +14056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14682,9 +14174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14780,9 +14269,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14881,9 +14367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14989,9 +14472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15100,9 +14580,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15246,9 +14723,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15394,9 +14868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15492,9 +14963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15593,9 +15061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15691,9 +15156,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15792,9 +15254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15890,9 +15349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15991,9 +15447,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16089,9 +15542,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16190,9 +15640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16246,9 +15693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16311,9 +15755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16389,9 +15830,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16467,9 +15905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16544,9 +15979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16630,9 +16062,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16693,9 +16122,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16773,9 +16199,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16838,9 +16261,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16916,9 +16336,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17005,9 +16422,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17097,9 +16511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17165,9 +16576,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17241,9 +16649,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17317,9 +16722,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17447,9 +16849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17509,9 +16908,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17636,9 +17032,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17702,9 +17095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17792,9 +17182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17894,9 +17281,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17970,9 +17354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18063,9 +17444,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18134,9 +17512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18205,9 +17580,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18425,9 +17797,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18503,9 +17872,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18583,9 +17949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18672,9 +18035,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18738,9 +18098,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18816,9 +18173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18884,9 +18238,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18974,9 +18325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19089,9 +18437,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19165,9 +18510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19256,9 +18598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19333,9 +18672,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19434,9 +18770,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19498,9 +18831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19582,9 +18912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19658,9 +18985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19749,9 +19073,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19837,9 +19158,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19925,9 +19243,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19996,9 +19311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20060,9 +19372,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20148,9 +19457,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20236,9 +19542,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20354,9 +19657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20460,9 +19760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20568,9 +19865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20623,9 +19917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20687,9 +19978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20770,9 +20058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20855,9 +20140,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20941,9 +20223,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21018,9 +20297,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21082,9 +20358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21138,15 +20411,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -21165,9 +20431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21244,9 +20507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21308,9 +20568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21370,9 +20627,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21432,9 +20686,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21496,9 +20747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21579,9 +20827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21662,9 +20907,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21745,9 +20987,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21807,9 +21046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21890,9 +21126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21952,9 +21185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22007,9 +21237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22064,9 +21291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22138,9 +21362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22222,9 +21443,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22298,9 +21516,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22411,9 +21626,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22484,9 +21696,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22576,9 +21785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22650,9 +21856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22735,9 +21938,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22818,9 +22018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index b414baf7a5..d4d33fb9e3 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -102,9 +102,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -155,9 +152,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -248,9 +242,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -330,9 +321,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -394,9 +382,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -459,9 +444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -581,9 +560,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -656,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -724,9 +697,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -805,9 +775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -875,9 +842,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -954,9 +918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1036,9 +997,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1091,9 +1049,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1144,9 +1099,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1197,9 +1149,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1252,9 +1201,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1327,9 +1273,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1408,9 +1351,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1490,9 +1430,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1543,9 +1480,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1621,9 +1555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1701,9 +1632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1790,9 +1718,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1838,9 +1763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1893,9 +1815,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1946,9 +1865,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2026,9 +1942,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2103,9 +2016,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2241,9 +2151,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2321,9 +2228,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2401,9 +2305,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2464,9 +2365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2522,9 +2420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2587,9 +2482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2641,9 +2533,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2727,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2801,9 +2687,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2865,9 +2748,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2954,9 +2834,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3043,9 +2920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3184,9 +3058,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3264,9 +3135,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3337,9 +3205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3422,9 +3287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3475,9 +3337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3558,9 +3417,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3687,9 +3543,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3820,9 +3673,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3887,9 +3737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4378,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4465,9 +4309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4560,9 +4401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4655,9 +4493,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4739,9 +4574,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -4754,10 +4586,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -4868,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4940,7 +4769,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -4971,9 +4802,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5063,9 +4891,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5155,9 +4980,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5254,9 +5076,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5336,9 +5155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5421,9 +5237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5542,9 +5355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5616,9 +5426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5692,9 +5499,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5768,9 +5572,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5824,9 +5625,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5880,9 +5678,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5936,9 +5731,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5992,9 +5784,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6048,9 +5837,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -6104,9 +5890,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6160,9 +5943,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6217,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6304,9 +6081,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6378,9 +6152,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6463,9 +6234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6557,9 +6325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6629,9 +6394,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6720,9 +6482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6794,9 +6553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6868,9 +6624,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7069,9 +6822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7143,9 +6893,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7220,9 +6967,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7314,9 +7058,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7378,9 +7119,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7455,9 +7193,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7521,9 +7256,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7606,9 +7338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7723,9 +7452,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7795,9 +7521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7883,9 +7606,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7956,9 +7676,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8054,9 +7771,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8117,9 +7831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index bc1450a9db..1c1dbd3a9c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -114,9 +114,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -166,9 +163,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -251,9 +245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -304,9 +295,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -385,9 +373,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -448,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -565,9 +544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -633,9 +609,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -707,9 +680,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -774,9 +744,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -854,9 +821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -923,9 +887,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1002,9 +963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1083,9 +1041,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1137,9 +1092,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1189,9 +1141,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1241,9 +1190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1295,9 +1241,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1369,9 +1312,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1449,9 +1389,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1530,9 +1467,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1582,9 +1516,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1659,9 +1590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1738,9 +1666,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1826,9 +1751,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1873,9 +1795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1927,9 +1846,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1980,9 +1896,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2060,9 +1973,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2137,9 +2047,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2275,9 +2182,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2355,9 +2259,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2435,9 +2336,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2497,9 +2395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2554,9 +2449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2618,9 +2510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2671,9 +2560,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2756,9 +2642,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2829,9 +2712,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2892,9 +2772,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2981,9 +2858,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3070,9 +2944,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3211,9 +3082,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3291,9 +3159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3363,9 +3228,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3447,9 +3309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3499,9 +3358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3581,9 +3437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3710,9 +3563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3843,9 +3693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3910,9 +3757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4401,9 +4245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4488,9 +4329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4583,9 +4421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4676,9 +4511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4748,9 +4580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4800,9 +4629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4874,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4960,9 +4783,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5034,9 +4854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5095,9 +4912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5175,9 +4989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5238,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5320,9 +5128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5429,9 +5234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5498,9 +5300,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5601,9 +5400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5672,9 +5468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5755,9 +5548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5863,9 +5653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5973,9 +5760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6081,9 +5865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6191,9 +5972,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6299,9 +6077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6409,9 +6184,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6527,9 +6299,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6647,9 +6416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6767,9 +6533,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6891,9 +6654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7011,9 +6771,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7135,9 +6892,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7243,9 +6997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7353,9 +7104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7488,9 +7236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7609,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7725,9 +7467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7833,9 +7572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7974,9 +7710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8045,9 +7778,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8123,9 +7853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8231,9 +7958,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8315,9 +8039,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -8330,10 +8051,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -8444,9 +8165,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8516,7 +8234,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8547,9 +8267,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8639,9 +8356,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8731,9 +8445,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8830,9 +8541,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8910,9 +8618,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9000,9 +8705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9081,9 +8783,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9203,9 +8902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9274,9 +8970,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9352,9 +9045,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9434,9 +9124,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9524,9 +9211,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9598,9 +9282,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9680,9 +9361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9754,9 +9432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10027,9 +9702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10081,9 +9753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10134,9 +9803,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10232,9 +9898,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10294,9 +9957,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10368,9 +10028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10429,9 +10086,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10672,9 +10326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10735,9 +10386,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10817,9 +10465,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10911,9 +10556,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10980,9 +10622,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11044,9 +10683,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11112,9 +10748,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11196,9 +10829,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11268,9 +10898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11342,9 +10969,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11427,9 +11051,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11548,9 +11169,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11613,9 +11231,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11684,9 +11299,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11766,9 +11378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11827,9 +11436,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11915,9 +11521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11984,9 +11587,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12072,9 +11672,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12145,9 +11742,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12221,9 +11815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12295,9 +11886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12348,9 +11936,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12401,9 +11986,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12454,9 +12036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12516,9 +12095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12569,9 +12145,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12622,9 +12195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12675,9 +12245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12739,9 +12306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12803,9 +12367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12876,9 +12437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12940,9 +12498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13028,9 +12583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13092,9 +12644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13156,9 +12705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13220,9 +12766,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13284,9 +12827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13348,9 +12888,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13412,9 +12949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13476,9 +13010,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13540,9 +13071,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13593,9 +13121,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13646,9 +13171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13701,9 +13223,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13757,9 +13276,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13813,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13869,9 +13382,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13925,9 +13435,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13981,9 +13488,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -14037,9 +13541,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -14093,9 +13594,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -14148,9 +13646,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14225,9 +13720,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14385,9 +13877,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14542,9 +14031,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14717,9 +14203,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14889,9 +14372,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15009,9 +14489,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15127,9 +14604,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15184,9 +14658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15248,9 +14719,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15324,9 +14792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15400,9 +14865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15477,9 +14939,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15594,9 +15053,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15709,9 +15165,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15802,9 +15255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15893,9 +15343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16022,9 +15469,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16149,9 +15593,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16254,9 +15695,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16357,9 +15795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16474,9 +15909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16589,9 +16021,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16750,9 +16179,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16908,9 +16334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17013,9 +16436,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17116,9 +16536,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17221,9 +16638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17324,9 +16738,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17429,9 +16840,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17532,9 +16940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17637,9 +17042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17740,9 +17142,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17797,9 +17196,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17861,9 +17257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17937,9 +17330,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18013,9 +17403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18088,9 +17475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18180,9 +17564,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18242,9 +17623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18323,9 +17701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18387,9 +17762,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18463,9 +17835,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18548,9 +17917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18638,9 +18004,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18705,9 +18068,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18777,9 +18137,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18852,9 +18209,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18948,9 +18302,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19038,9 +18389,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19120,9 +18468,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19172,9 +18517,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19254,9 +18596,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19306,9 +18645,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19379,9 +18715,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19452,9 +18785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19575,9 +18905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19697,9 +19024,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19813,9 +19137,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19928,9 +19249,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19988,9 +19306,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20043,9 +19358,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20105,9 +19417,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20191,9 +19500,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20241,9 +19547,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20320,9 +19623,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20380,9 +19680,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20459,9 +19756,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20521,9 +19815,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20594,9 +19885,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20746,9 +20034,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20806,9 +20091,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20933,9 +20215,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20995,9 +20274,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21089,9 +20365,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21169,9 +20442,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21249,9 +20519,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21329,9 +20596,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21409,9 +20673,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21503,9 +20764,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21586,9 +20844,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21666,9 +20921,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21746,9 +20998,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21826,9 +21075,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21906,9 +21152,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22005,9 +21248,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22094,9 +21334,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22154,9 +21391,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22250,9 +21484,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22318,9 +21549,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22415,9 +21643,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22485,9 +21710,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22626,9 +21848,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22686,9 +21905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22810,9 +22026,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22878,9 +22091,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22977,9 +22187,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23047,9 +22254,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23149,9 +22353,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23229,9 +22430,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23360,9 +22558,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23500,9 +22695,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23580,9 +22772,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23802,9 +22991,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24036,7 +23222,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -24065,9 +23253,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24289,9 +23474,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24508,9 +23690,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24714,7 +23893,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -24743,9 +23924,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24964,9 +24142,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25024,9 +24199,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25146,9 +24318,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25214,9 +24383,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25337,9 +24503,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25407,9 +24570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25477,9 +24637,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25550,9 +24707,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25641,9 +24795,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25696,9 +24847,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25758,9 +24906,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25820,9 +24965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25894,9 +25036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26035,9 +25174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26096,9 +25232,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26231,9 +25364,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26296,9 +25426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26381,9 +25508,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26475,9 +25599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26547,9 +25668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26638,9 +25756,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26712,9 +25827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26786,9 +25898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26987,9 +26096,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27059,9 +26165,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27133,9 +26236,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27217,9 +26317,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27294,9 +26391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27388,9 +26482,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27452,9 +26543,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27529,9 +26617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27593,9 +26678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27669,9 +26751,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27754,9 +26833,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27871,9 +26947,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27943,9 +27016,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28031,9 +27101,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28104,9 +27171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28201,9 +27265,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28263,9 +27324,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28344,9 +27402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28418,9 +27473,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28515,9 +27567,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28608,9 +27657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28701,9 +27747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28772,9 +27815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28835,9 +27875,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28928,9 +27965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29021,9 +28055,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29149,9 +28180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29263,9 +28291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29377,9 +28402,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29451,9 +28473,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29507,9 +28526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29570,9 +28586,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29651,9 +28664,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29735,9 +28745,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29819,9 +28826,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29894,9 +28898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29957,9 +28958,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30013,11 +29011,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -30036,9 +29031,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30112,9 +29104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30175,9 +29164,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30236,9 +29222,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30297,9 +29280,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30360,9 +29340,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30441,9 +29418,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30522,9 +29496,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30603,9 +29574,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30664,9 +29632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30745,9 +29710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30806,9 +29768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30862,9 +29821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30920,9 +29876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30991,9 +29944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31073,9 +30023,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31147,9 +30094,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31262,9 +30206,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31332,9 +30273,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31424,9 +30362,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31495,9 +30430,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31579,9 +30511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31660,9 +30589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31741,9 +30667,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31810,9 +30733,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31897,9 +30817,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31967,9 +30884,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32037,9 +30951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32116,9 +31027,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32198,9 +31106,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32286,9 +31191,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32361,9 +31263,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32416,9 +31315,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 29030aef75..5b069cb633 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -117,9 +117,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -171,9 +168,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -264,9 +258,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -347,9 +338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -412,9 +400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -478,9 +463,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -531,9 +513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -601,9 +580,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -677,9 +653,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -746,9 +719,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -828,9 +798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -899,9 +866,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -978,9 +942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1061,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1117,9 +1075,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1171,9 +1126,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1225,9 +1177,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1281,9 +1230,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1357,9 +1303,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1439,9 +1382,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1522,9 +1462,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1576,9 +1513,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1655,9 +1589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1736,9 +1667,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1826,9 +1754,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1875,9 +1800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1931,9 +1853,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1984,9 +1903,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2064,9 +1980,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2144,9 +2057,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2224,9 +2134,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2304,9 +2211,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2368,9 +2272,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2427,9 +2328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2493,9 +2391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2549,9 +2444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2638,9 +2530,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2727,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2868,9 +2754,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2948,9 +2831,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3022,9 +2902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3108,9 +2985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3162,9 +3036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3246,9 +3117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3377,9 +3245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3512,9 +3377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3581,9 +3443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4074,9 +3933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4163,9 +4019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4260,9 +4113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4355,9 +4205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4430,9 +4277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4517,9 +4361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4579,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4660,9 +4498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4724,9 +4559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4807,9 +4639,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4917,9 +4746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4987,9 +4813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5091,9 +4914,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5163,9 +4983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5247,9 +5064,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5356,9 +5170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5467,9 +5278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5576,9 +5384,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5687,9 +5492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5796,9 +5598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5907,9 +5706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6026,9 +5822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6147,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6268,9 +6058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6393,9 +6180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6514,9 +6298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6639,9 +6420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6748,9 +6526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6859,9 +6634,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6995,9 +6767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7117,9 +6886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7234,9 +7000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7343,9 +7106,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7485,9 +7245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7557,9 +7314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7636,9 +7390,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7745,9 +7496,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7831,9 +7579,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -7846,10 +7591,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -7962,9 +7707,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8036,7 +7778,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8067,9 +7811,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8161,9 +7902,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8255,9 +7993,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8356,9 +8091,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8438,9 +8170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8520,9 +8249,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8643,9 +8369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8715,9 +8438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8794,9 +8514,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8869,9 +8586,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9143,9 +8857,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9198,9 +8909,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9252,9 +8960,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9314,9 +9019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9558,9 +9260,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9622,9 +9321,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9705,9 +9401,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9800,9 +9493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9870,9 +9560,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9935,9 +9622,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10004,9 +9688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10089,9 +9770,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10162,9 +9840,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10237,9 +9912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10324,9 +9996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10447,9 +10116,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10514,9 +10180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10586,9 +10249,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10648,9 +10308,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10737,9 +10394,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10807,9 +10461,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10896,9 +10547,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10970,9 +10618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11048,9 +10693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11124,9 +10766,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11178,9 +10817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11232,9 +10868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11286,9 +10919,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11349,9 +10979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11403,9 +11030,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11457,9 +11081,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11511,9 +11132,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11576,9 +11194,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11641,9 +11256,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11715,9 +11327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11780,9 +11389,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11869,9 +11475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11934,9 +11537,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11999,9 +11599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12064,9 +11661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12129,9 +11723,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12194,9 +11785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12259,9 +11847,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12324,9 +11909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12389,9 +11971,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12443,9 +12022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12497,9 +12073,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12553,9 +12126,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12611,9 +12181,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12669,9 +12236,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12727,9 +12291,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12785,9 +12346,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12843,9 +12401,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12901,9 +12456,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12959,9 +12511,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -13016,9 +12565,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13094,9 +12640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13255,9 +12798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13413,9 +12953,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13589,9 +13126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13762,9 +13296,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13883,9 +13414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14002,9 +13530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14060,9 +13585,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14125,9 +13647,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14202,9 +13721,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14279,9 +13795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14357,9 +13870,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14475,9 +13985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14591,9 +14098,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14685,9 +14189,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14777,9 +14278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14907,9 +14405,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15035,9 +14530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15141,9 +14633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15245,9 +14734,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15363,9 +14849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15479,9 +14962,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15641,9 +15121,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15800,9 +15277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15906,9 +15380,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16010,9 +15481,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16116,9 +15584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16220,9 +15685,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16326,9 +15788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16430,9 +15889,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16536,9 +15992,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16640,9 +16093,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16698,9 +16148,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16763,9 +16210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16840,9 +16284,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16917,9 +16358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16993,9 +16431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17086,9 +16521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17149,9 +16581,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17231,9 +16660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17296,9 +16722,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17373,9 +16796,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17459,9 +16879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17551,9 +16968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17619,9 +17033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17693,9 +17104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17768,9 +17176,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17910,9 +17315,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17972,9 +17374,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -18108,9 +17507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -18174,9 +17570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18261,9 +17654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18357,9 +17747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18431,9 +17818,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18524,9 +17908,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18600,9 +17981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18676,9 +18054,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18879,9 +18254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18955,9 +18327,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19034,9 +18403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19130,9 +18496,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19196,9 +18559,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19275,9 +18635,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19343,9 +18700,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19430,9 +18784,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19549,9 +18900,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19623,9 +18971,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19713,9 +19058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19788,9 +19130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19887,9 +19226,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19951,9 +19287,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -20034,9 +19367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20109,9 +19439,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20207,9 +19534,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20301,9 +19625,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20395,9 +19716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20467,9 +19785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20531,9 +19846,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20625,9 +19937,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20719,9 +20028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20848,9 +20154,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20963,9 +20266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21078,9 +20378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21135,9 +20432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21199,9 +20493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21281,9 +20572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21366,9 +20654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21451,9 +20736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21527,9 +20809,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21591,9 +20870,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21648,11 +20924,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -21671,9 +20944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21748,9 +21018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21812,9 +21079,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21874,9 +21138,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21936,9 +21197,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22000,9 +21258,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22082,9 +21337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22164,9 +21416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22246,9 +21495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22308,9 +21554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22390,9 +21633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22452,9 +21692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22509,9 +21746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22568,9 +21802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22640,9 +21871,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22723,9 +21951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22798,9 +22023,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22914,9 +22136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22985,9 +22204,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23078,9 +22294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23150,9 +22363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23235,9 +22445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23317,9 +22524,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 8e29b02518..6fc6d66ff6 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -25,7 +25,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; @@ -295,7 +295,7 @@ App::post('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -438,7 +438,7 @@ App::get('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -467,7 +467,7 @@ App::delete('/v1/account') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->inject('user') ->inject('project') @@ -519,7 +519,7 @@ App::get('/v1/account/sessions') model: Response::MODEL_SESSION_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->inject('response') ->inject('user') @@ -568,7 +568,7 @@ App::delete('/v1/account/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->label('abuse-limit', 100) ->inject('request') @@ -637,7 +637,7 @@ App::get('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') @@ -690,7 +690,7 @@ App::delete('/v1/account/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') @@ -778,7 +778,7 @@ App::patch('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to update the current device session.') @@ -862,7 +862,7 @@ App::post('/v1/account/sessions/email') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -1002,7 +1002,7 @@ App::post('/v1/account/sessions/anonymous') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') @@ -1145,7 +1145,7 @@ App::post('/v1/account/sessions/token') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') @@ -1171,7 +1171,7 @@ App::get('/v1/account/sessions/oauth2/:provider') namespace: 'account', name: 'createOAuth2Session', description: '/docs/references/account/create-session-oauth2.md', - methodType: MethodType::WEBAUTH, + type: MethodType::WEBAUTH, auth: [], responses: [ new SDKResponse( @@ -1179,7 +1179,7 @@ App::get('/v1/account/sessions/oauth2/:provider') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, + contentType: ContentType::HTML, hide: [APP_PLATFORM_SERVER], )) ->label('abuse-limit', 50) @@ -1775,8 +1775,8 @@ App::get('/v1/account/tokens/oauth2/:provider') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, - methodType: MethodType::WEBAUTH, + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') @@ -1855,7 +1855,7 @@ App::post('/v1/account/tokens/magic-url') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -2105,7 +2105,7 @@ App::post('/v1/account/tokens/email') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -2340,7 +2340,7 @@ App::put('/v1/account/sessions/magic-url') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, deprecated: true, )) ->label('abuse-limit', 10) @@ -2377,7 +2377,7 @@ App::put('/v1/account/sessions/phone') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, deprecated: true, )) ->label('abuse-limit', 10) @@ -2415,7 +2415,7 @@ App::post('/v1/account/tokens/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) @@ -2599,7 +2599,7 @@ App::post('/v1/account/jwts') model: Response::MODEL_JWT, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -2647,7 +2647,7 @@ App::get('/v1/account/prefs') model: Response::MODEL_PREFERENCES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -2673,7 +2673,7 @@ App::get('/v1/account/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2747,7 +2747,7 @@ App::patch('/v1/account/name') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -2785,7 +2785,7 @@ App::patch('/v1/account/password') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -2858,7 +2858,7 @@ App::patch('/v1/account/email') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -2954,7 +2954,7 @@ App::patch('/v1/account/phone') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -3039,7 +3039,7 @@ App::patch('/v1/account/prefs') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') @@ -3076,7 +3076,7 @@ App::patch('/v1/account/status') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->inject('requestTimestamp') ->inject('request') @@ -3126,7 +3126,7 @@ App::post('/v1/account/recovery') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -3312,7 +3312,7 @@ App::put('/v1/account/recovery') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3402,7 +3402,7 @@ App::post('/v1/account/verification') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -3573,7 +3573,7 @@ App::put('/v1/account/verification') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3639,7 +3639,7 @@ App::post('/v1/account/verification/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) @@ -3772,7 +3772,7 @@ App::put('/v1/account/verification/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') @@ -3837,7 +3837,7 @@ App::patch('/v1/account/mfa') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') @@ -3890,7 +3890,7 @@ App::get('/v1/account/mfa/factors') model: Response::MODEL_MFA_FACTORS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -3930,7 +3930,7 @@ App::post('/v1/account/mfa/authenticators/:type') model: Response::MODEL_MFA_TYPE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') @@ -4006,7 +4006,7 @@ App::put('/v1/account/mfa/authenticators/:type') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') @@ -4075,7 +4075,7 @@ App::post('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -4121,7 +4121,7 @@ App::patch('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('dbForProject') ->inject('response') @@ -4162,7 +4162,7 @@ App::get('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -4200,7 +4200,7 @@ App::delete('/v1/account/mfa/authenticators/:type') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4245,7 +4245,7 @@ App::post('/v1/account/mfa/challenge') model: Response::MODEL_MFA_CHALLENGE, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -4439,7 +4439,7 @@ App::put('/v1/account/mfa/challenge') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') @@ -4532,7 +4532,7 @@ App::post('/v1/account/targets/push') model: Response::MODEL_TARGET, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4612,7 +4612,7 @@ App::put('/v1/account/targets/:targetId/push') model: Response::MODEL_TARGET, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4676,7 +4676,7 @@ App::delete('/v1/account/targets/:targetId/push') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4726,7 +4726,7 @@ App::get('/v1/account/identities') model: Response::MODEL_IDENTITY_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -4797,7 +4797,7 @@ App::delete('/v1/account/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index e06b8c9ff1..d8a50e15b4 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -5,7 +5,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; @@ -174,14 +174,14 @@ App::get('/v1/avatars/credit-cards/:code') name: 'getCreditCard', description: '/docs/references/avatars/get-credit-card.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -201,14 +201,14 @@ App::get('/v1/avatars/browsers/:code') name: 'getBrowser', description: '/docs/references/avatars/get-browser.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -228,14 +228,14 @@ App::get('/v1/avatars/flags/:code') name: 'getFlag', description: '/docs/references/avatars/get-flag.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -255,14 +255,14 @@ App::get('/v1/avatars/image') name: 'getImage', description: '/docs/references/avatars/get-image.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE + contentType: ContentType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -325,14 +325,14 @@ App::get('/v1/avatars/favicon') name: 'getFavicon', description: '/docs/references/avatars/get-favicon.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE + contentType: ContentType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') @@ -475,14 +475,14 @@ App::get('/v1/avatars/qr') name: 'getQR', description: '/docs/references/avatars/get-qr.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) @@ -523,14 +523,14 @@ App::get('/v1/avatars/initials') name: 'getInitials', description: '/docs/references/avatars/get-initials.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 1d5cc085d6..da4ecf8551 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -4,7 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Document; @@ -36,7 +36,7 @@ App::get('/v1/console/variables') model: Response::MODEL_CONSOLE_VARIABLES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -81,7 +81,7 @@ App::post('/v1/console/assistant') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::TEXT + contentType: ContentType::TEXT )) ->label('abuse-limit', 15) ->label('abuse-key', 'userId:{userId}') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 825b4601e9..b56401ffd5 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -10,7 +10,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -463,7 +463,7 @@ App::post('/v1/databases') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') @@ -545,7 +545,7 @@ App::get('/v1/databases') model: Response::MODEL_DATABASE_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -607,7 +607,7 @@ App::get('/v1/databases/:databaseId') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -639,7 +639,7 @@ App::get('/v1/databases/:databaseId/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -740,7 +740,7 @@ App::put('/v1/databases/:databaseId') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') @@ -785,7 +785,7 @@ App::delete('/v1/databases/:databaseId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -841,7 +841,7 @@ App::post('/v1/databases/:databaseId/collections') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -912,7 +912,7 @@ App::get('/v1/databases/:databaseId/collections') model: Response::MODEL_COLLECTION_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) @@ -984,7 +984,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1025,7 +1025,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1130,7 +1130,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1204,7 +1204,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -2076,7 +2076,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin model: Response::MODEL_ATTRIBUTE_STRING, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2127,7 +2127,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email model: Response::MODEL_ATTRIBUTE_EMAIL, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2176,7 +2176,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ model: Response::MODEL_ATTRIBUTE_ENUM, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2227,7 +2227,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k model: Response::MODEL_ATTRIBUTE_IP, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2276,7 +2276,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: model: Response::MODEL_ATTRIBUTE_URL, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2325,7 +2325,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ model: Response::MODEL_ATTRIBUTE_INTEGER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2384,7 +2384,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float model: Response::MODEL_ATTRIBUTE_FLOAT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2443,7 +2443,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole model: Response::MODEL_ATTRIBUTE_BOOLEAN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2491,7 +2491,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet model: Response::MODEL_ATTRIBUTE_DATETIME, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2539,7 +2539,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2604,7 +2604,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2725,7 +2725,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') model: Response::MODEL_INDEX, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2899,7 +2899,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') model: Response::MODEL_INDEX_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2981,7 +2981,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_INDEX, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3030,7 +3030,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3107,7 +3107,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, parameters: [ 'documentId' => ['optional' => false], 'data' => ['optional' => false], @@ -3125,7 +3125,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, parameters: [ 'documents' => ['optional' => false], ] @@ -3425,7 +3425,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3585,7 +3585,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3682,7 +3682,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -3799,7 +3799,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4040,7 +4040,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4182,7 +4182,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4305,7 +4305,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4413,7 +4413,7 @@ App::get('/v1/databases/usage') model: Response::MODEL_USAGE_DATABASES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4502,7 +4502,7 @@ App::get('/v1/databases/:databaseId/usage') model: Response::MODEL_USAGE_DATABASE, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) @@ -4597,7 +4597,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') model: Response::MODEL_USAGE_COLLECTION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8c125e5c13..b732a0dcfb 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -18,7 +18,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; @@ -1025,8 +1025,8 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::ANY, - methodType: MethodType::LOCATION + contentType: ContentType::ANY, + type: MethodType::LOCATION )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1189,7 +1189,7 @@ App::delete('/v1/functions/:functionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1245,7 +1245,7 @@ App::post('/v1/functions/:functionId/deployments') ) ], requestType: 'multipart/form-data', - methodType: MethodType::UPLOAD, + type: MethodType::UPLOAD, packaging: true, )) ->param('functionId', '', new UID(), 'Function ID.') @@ -1607,7 +1607,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1850,7 +1850,7 @@ App::post('/v1/functions/:functionId/executions') model: Response::MODEL_EXECUTION, ) ], - responseType: ResponseType::MULTIPART, + contentType: ContentType::MULTIPART, requestType: 'application/json', )) ->param('functionId', '', new UID(), 'Function ID.') @@ -2407,7 +2407,7 @@ App::delete('/v1/functions/:functionId/executions/:executionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2704,7 +2704,7 @@ App::delete('/v1/functions/:functionId/variables/:variableId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 62a7c72d61..72951b608e 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -99,7 +99,7 @@ App::post('/v1/graphql/mutation') model: Response::MODEL_ANY, ) ], - methodType: MethodType::GRAPHQL, + type: MethodType::GRAPHQL, additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], @@ -149,7 +149,7 @@ App::post('/v1/graphql') model: Response::MODEL_ANY, ) ], - methodType: MethodType::GRAPHQL, + type: MethodType::GRAPHQL, additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index baa737ce1e..226349f614 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -6,7 +6,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -41,7 +41,7 @@ App::get('/v1/health') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -79,7 +79,7 @@ App::get('/v1/health/db') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -139,7 +139,7 @@ App::get('/v1/health/cache') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -203,7 +203,7 @@ App::get('/v1/health/queue') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -266,7 +266,7 @@ App::get('/v1/health/pubsub') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -330,7 +330,7 @@ App::get('/v1/health/time') model: Response::MODEL_HEALTH_TIME, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -393,7 +393,7 @@ App::get('/v1/health/queue/webhooks') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -426,7 +426,7 @@ App::get('/v1/health/queue/logs') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -459,7 +459,7 @@ App::get('/v1/health/certificate') model: Response::MODEL_HEALTH_CERTIFICATE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') @@ -515,7 +515,7 @@ App::get('/v1/health/queue/certificates') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -548,7 +548,7 @@ App::get('/v1/health/queue/builds') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -581,7 +581,7 @@ App::get('/v1/health/queue/databases') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -615,7 +615,7 @@ App::get('/v1/health/queue/deletes') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -648,7 +648,7 @@ App::get('/v1/health/queue/mails') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -681,7 +681,7 @@ App::get('/v1/health/queue/messaging') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -714,7 +714,7 @@ App::get('/v1/health/queue/migrations') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -747,7 +747,7 @@ App::get('/v1/health/queue/functions') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -780,7 +780,7 @@ App::get('/v1/health/queue/usage') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -813,7 +813,7 @@ App::get('/v1/health/queue/usage-dump') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -846,7 +846,7 @@ App::get('/v1/health/storage/local') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -895,7 +895,7 @@ App::get('/v1/health/storage') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('deviceForFiles') @@ -942,7 +942,7 @@ App::get('/v1/health/anti-virus') model: Response::MODEL_HEALTH_ANTIVIRUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -987,7 +987,7 @@ App::get('/v1/health/queue/failed/:name') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', '', new WhiteList([ Event::DATABASE_QUEUE_NAME, diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 7a1bbc5994..45ab4c18e5 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -14,7 +14,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -2052,7 +2052,7 @@ App::delete('/v1/messaging/providers/:providerId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2381,7 +2381,7 @@ App::delete('/v1/messaging/topics/:topicId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2755,7 +2755,7 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -4157,7 +4157,7 @@ App::delete('/v1/messaging/messages/:messageId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 71156df789..fe0f48b3e9 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -10,7 +10,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -709,7 +709,7 @@ App::get('/v1/migrations/firebase/connect') ) ], hide: true, - methodType: MethodType::WEBAUTH + type: MethodType::WEBAUTH )) ->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients']) ->param('projectId', '', new UID(), 'Project ID') @@ -1145,7 +1145,7 @@ App::delete('/v1/migrations/:migrationId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 0ad69ab1ec..d50f5f1d46 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -4,7 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -503,7 +503,7 @@ App::delete('/v1/project/variables/:variableId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 451e732306..4df8566bc0 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -1085,7 +1085,7 @@ App::delete('/v1/projects/:projectId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1380,7 +1380,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1613,7 +1613,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1890,7 +1890,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -2306,7 +2306,7 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') model: Response::MODEL_SMS_TEMPLATE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2356,7 +2356,7 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') model: Response::MODEL_EMAIL_TEMPLATE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index e3917acc02..b824f0f1fc 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -8,7 +8,7 @@ use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -281,7 +281,7 @@ App::delete('/v1/proxy/rules/:ruleId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index b2a3f23dfb..1b0d72100c 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -12,7 +12,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; @@ -340,7 +340,7 @@ App::delete('/v1/storage/buckets/:bucketId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -386,7 +386,7 @@ App::post('/v1/storage/buckets/:bucketId/files') namespace: 'storage', name: 'createFile', description: '/docs/references/storage/create-file.md', - methodType: MethodType::UPLOAD, + type: MethodType::UPLOAD, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], requestType: 'multipart/form-data', responses: [ @@ -915,8 +915,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') model: Response::MODEL_NONE ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::IMAGE + type: MethodType::LOCATION, + contentType: ContentType::IMAGE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') @@ -1092,8 +1092,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') model: Response::MODEL_NONE ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::ANY, + type: MethodType::LOCATION, + contentType: ContentType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1240,8 +1240,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') model: Response::MODEL_NONE, ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::ANY, + type: MethodType::LOCATION, + contentType: ContentType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1674,7 +1674,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 2cc88e11a7..b3f5e75979 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -14,7 +14,7 @@ use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -377,7 +377,7 @@ App::delete('/v1/teams/:teamId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -1214,7 +1214,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 64b7f5dbc8..4694cbc5d5 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -18,7 +18,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -1903,11 +1903,11 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') auth: [AuthType::KEY], responses: [ new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USER, + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -2090,7 +2090,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2140,7 +2140,7 @@ App::delete('/v1/users/:userId/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2189,7 +2189,7 @@ App::delete('/v1/users/:userId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2238,7 +2238,7 @@ App::delete('/v1/users/:userId/targets/:targetId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2295,7 +2295,7 @@ App::delete('/v1/users/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE, + contentType: ContentType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 2c4424a348..b2272bad42 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -8,7 +8,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -285,8 +285,8 @@ App::get('/v1/vcs/github/authorize') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, - methodType: MethodType::WEBAUTH, + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, hide: true, )) ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) @@ -1192,7 +1192,7 @@ App::delete('/v1/vcs/installations/:installationId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') diff --git a/app/controllers/general.php b/app/controllers/general.php index 4cee363317..515b89dc5e 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -111,7 +111,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo model: Response::MODEL_EXECUTION, ) ], - responseType: ResponseType::MULTIPART, + contentType: ContentType::MULTIPART, requestType: 'application/json', )); } else { diff --git a/src/Appwrite/SDK/ResponseType.php b/src/Appwrite/SDK/ContentType.php similarity index 91% rename from src/Appwrite/SDK/ResponseType.php rename to src/Appwrite/SDK/ContentType.php index 8d34fb1a90..174c889815 100644 --- a/src/Appwrite/SDK/ResponseType.php +++ b/src/Appwrite/SDK/ContentType.php @@ -2,7 +2,7 @@ namespace Appwrite\SDK; -enum ResponseType: string +enum ContentType: string { case NONE = ''; case JSON = 'application/json'; diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index c1c4a3e6e2..f6859209cb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -20,7 +20,7 @@ class Method * @param string $description * @param array $auth * @param array $responses - * @param ResponseType $responseType + * @param ContentType $responseType * @param MethodType|null $methodType * @param bool $deprecated * @param array|bool $hide @@ -37,8 +37,8 @@ class Method protected string $description, protected array $auth, protected array $responses, - protected ResponseType $responseType = ResponseType::JSON, - protected ?MethodType $methodType = null, + protected ContentType $contentType = ContentType::JSON, + protected ?MethodType $type = null, protected bool $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, @@ -157,14 +157,14 @@ class Method return $this->responses; } - public function getResponseType(): ResponseType + public function getContentType(): ContentType { - return $this->responseType; + return $this->contentType; } - public function getMethodType(): ?MethodType + public function getType(): ?MethodType { - return $this->methodType; + return $this->type; } public function isDeprecated(): bool @@ -235,15 +235,15 @@ class Method return $this; } - public function setResponseType(ResponseType $responseType): self + public function setContentType(ContentType $contentType): self { - $this->responseType = $responseType; + $this->contentType = $contentType; return $this; } - public function setMethodType(?MethodType $methodType): self + public function setType(?MethodType $type): self { - $this->methodType = $methodType; + $this->type = $type; return $this; } diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php index 9cd72951dc..e87813024b 100644 --- a/src/Appwrite/SDK/Response.php +++ b/src/Appwrite/SDK/Response.php @@ -11,8 +11,7 @@ class Response */ public function __construct( private int $code, - private string|array $model, - private string $description = '', + private string|array $model ) { } @@ -25,9 +24,4 @@ class Response { return $this->model; } - - public function getDescription(): string - { - return $this->description; - } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 3c8df24e48..02568a8ccf 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -149,7 +149,7 @@ class OpenAPI3 extends Format } $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; - $produces = ($sdk->getResponseType())->value; + $produces = ($sdk->getContentType())->value; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -187,7 +187,7 @@ class OpenAPI3 extends Format 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $sdk->getMethodType()->value ?? '', + 'type' => $sdk->getType()->value ?? '', 'deprecated' => $sdk->isDeprecated(), 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', @@ -224,7 +224,6 @@ class OpenAPI3 extends Format /** @var \Appwrite\SDK\Response $response */ $additionalMethod['responses'][] = [ 'code' => $response->getCode(), - 'description' => $response->getDescription(), 'model' => '#/components/schemas/' . $response->getModel() ]; } @@ -360,7 +359,7 @@ class OpenAPI3 extends Format $node['schema']['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($sdk->getMethodType() === MethodType::UPLOAD) { + if ($sdk->getType() === MethodType::UPLOAD) { $node['schema']['x-upload-id'] = true; } $node['schema']['type'] = $validator->getType(); diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d07d64d66a..22aac47113 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -145,7 +145,7 @@ class Swagger2 extends Format } $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; - $produces = ($sdk->getResponseType())->value; + $produces = ($sdk->getContentType())->value; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -185,7 +185,7 @@ class Swagger2 extends Format 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $sdk->getMethodType()->value ?? '', + 'type' => $sdk->getType()->value ?? '', 'deprecated' => $sdk->isDeprecated(), 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', @@ -210,7 +210,8 @@ class Swagger2 extends Format 'name' => $method->getMethodName(), 'parameters' => [], 'required' => [], - 'responses' => [] + 'responses' => [], + 'description' => $method->getDescription(), ]; foreach ($method->getParameters() as $name => $param) { @@ -225,7 +226,6 @@ class Swagger2 extends Format /** @var \Appwrite\SDK\Response $response */ $additionalMethod['responses'][] = [ 'code' => $response->getCode(), - 'description' => $response->getDescription(), 'model' => '#/definitions/' . $response->getModel() ]; } @@ -377,7 +377,7 @@ class Swagger2 extends Format $node['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($sdk->getMethodType() === MethodType::UPLOAD) { + if ($sdk->getType() === MethodType::UPLOAD) { $node['x-upload-id'] = true; } $node['type'] = $validator->getType(); From 1691910023183587a0eeceb5c0d1aafa4f910c00 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 12:56:46 +0900 Subject: [PATCH 082/161] Run Linter --- app/controllers/api/account.php | 2 +- app/controllers/api/avatars.php | 2 +- app/controllers/api/console.php | 2 +- app/controllers/api/databases.php | 2 +- app/controllers/api/functions.php | 2 +- app/controllers/api/health.php | 2 +- app/controllers/api/messaging.php | 2 +- app/controllers/api/migrations.php | 2 +- app/controllers/api/project.php | 2 +- app/controllers/api/projects.php | 2 +- app/controllers/api/proxy.php | 2 +- app/controllers/api/storage.php | 2 +- app/controllers/api/teams.php | 2 +- app/controllers/api/users.php | 2 +- app/controllers/api/vcs.php | 2 +- app/controllers/general.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 6fc6d66ff6..de73fb91b6 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -22,10 +22,10 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index d8a50e15b4..19ac4a6538 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -2,10 +2,10 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index da4ecf8551..dc93946714 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -2,9 +2,9 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Document; diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b56401ffd5..093ba7898b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -8,9 +8,9 @@ use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index b732a0dcfb..71312330fc 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -15,10 +15,10 @@ use Appwrite\Functions\Validator\RuntimeSpecification; use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 226349f614..1db4713311 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -4,9 +4,9 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 45ab4c18e5..65ea6a9e32 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -12,9 +12,9 @@ use Appwrite\Network\Validator\Email; use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index fe0f48b3e9..cbf6513daa 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -7,10 +7,10 @@ use Appwrite\Extend\Exception; use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index d50f5f1d46..61ceb8fff2 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -2,9 +2,9 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 4df8566bc0..e6df57a9cd 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -11,9 +11,9 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index b824f0f1fc..8f76443800 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -6,9 +6,9 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 1b0d72100c..3801b9007d 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -9,10 +9,10 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index b3f5e75979..8cc26555c9 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -12,9 +12,9 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 4694cbc5d5..92c6e1cd47 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -16,9 +16,9 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index b2272bad42..a471a7d76d 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -5,10 +5,10 @@ use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; diff --git a/app/controllers/general.php b/app/controllers/general.php index 515b89dc5e..5457f310b3 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -11,9 +11,9 @@ use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; From 48bf8001aeef1605c3adf2e74e16617a5768b748 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 16:17:35 +0900 Subject: [PATCH 083/161] Address Comments --- src/Appwrite/SDK/Method.php | 34 +++++++++++++-------------------- src/Appwrite/Utopia/Request.php | 26 +++++++++++++++++++------ 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index f6859209cb..8064b75561 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -8,7 +8,7 @@ use Swoole\Http\Response as HttpResponse; class Method { - public static array $knownMethods = []; + public static array $processed = []; public static array $errors = []; @@ -53,8 +53,6 @@ class Method foreach ($responses as $response) { /** @var SDKResponse $response */ $this->validateResponseModel($response->getModel()); - - // No content check $this->validateNoContent($response); } } @@ -66,11 +64,11 @@ class Method private function validateMethod(string $name, string $namespace): void { - if (\in_array($this->getRouteName(), self::$knownMethods)) { + if (\in_array($this->getRouteName(), self::$processed)) { self::$errors[] = "Error with {$this->getRouteName()} method: Method already exists in namespace {$namespace}"; } - self::$knownMethods[] = $this->getRouteName(); + self::$processed[] = $this->getRouteName(); } private function validateAuthTypes(array $authTypes): void @@ -101,22 +99,16 @@ class Method { $response = new Response(new HttpResponse()); - if (\is_array($responseModel)) { - foreach ($responseModel as $model) { - try { - $response->getModel($model); - } catch (\Exception $e) { - self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; - } - } - - return; + if (!\is_array($responseModel)) { + $responseModel = [$responseModel]; } - try { - $response->getModel($responseModel); - } catch (\Exception $e) { - self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + foreach ($responseModel as $model) { + try { + $response->getModel($model); + } catch (\Exception $e) { + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + } } } @@ -150,7 +142,7 @@ class Method } /** - * @return Array + * @return array */ public function getResponses(): array { @@ -223,7 +215,7 @@ class Method } /** - * @param Array $responses + * @param array $responses */ public function setResponses(array $responses): self { diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index a4fc0e0f63..086d694378 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -28,15 +28,29 @@ class Request extends UtopiaRequest $parameters = parent::getParams(); if ($this->hasFilters() && self::hasRoute()) { - $method = self::getRoute()->getLabel('sdk', null); - /** @var \Appwrite\SDK\Method $method */ + $methods = self::getRoute()->getLabel('sdk', null); - if (empty($method)) { - $endpointIdentifier = 'unknown.unknown'; - } else { - $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + if (!\is_array($methods)) { + $methods = [$methods]; } + $params = []; + + foreach ($methods as $method) { + /** @var \Appwrite\SDK\Method $method */ + if (empty($method)) { + $endpointIdentifier = 'unknown.unknown'; + } else { + $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + } + + $params += $method->getParameters(); + } + + $parameters = array_filter($parameters, function ($key) use ($params) { + return array_key_exists($key, $params); + }, \ARRAY_FILTER_USE_KEY); + foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); } From 9d04c61cbed6fa6f79cb893e02f6e35df1d2c8db Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 11:07:09 +0900 Subject: [PATCH 084/161] Attempt to fix tests --- src/Appwrite/Utopia/Request.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index 086d694378..f8c0439293 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -47,9 +47,11 @@ class Request extends UtopiaRequest $params += $method->getParameters(); } - $parameters = array_filter($parameters, function ($key) use ($params) { - return array_key_exists($key, $params); - }, \ARRAY_FILTER_USE_KEY); + if (!empty($params)) { + $parameters = array_filter($parameters, function ($key) use ($params) { + return array_key_exists($key, $params); + }, \ARRAY_FILTER_USE_KEY); + } foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); From 4c220881466dd46a18e828c6e6fe7838f9d9516b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 11:30:50 +0900 Subject: [PATCH 085/161] Address GraphQL --- src/Appwrite/GraphQL/Schema.php | 42 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index cbef55ef8d..9214bf8e20 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -105,31 +105,29 @@ class Schema continue; } - $additionalMethods = null; - if (is_array($sdk)) { - $mainSdk = array_shift($sdk); - $additionalMethods = $sdk; - - $sdk = $mainSdk; + if (!\is_array($sdk)) { + $sdk = [$sdk]; } - $namespace = $sdk->getNamespace(); - $method = $sdk->getMethodName(); - $name = $namespace . \ucfirst($method); + foreach ($sdk as $method) { + $namespace = $method->getNamespace(); + $methodName = $method->getMethodName(); + $name = $namespace . \ucfirst($methodName); - foreach (Mapper::route($utopia, $route, $complexity) as $field) { - switch ($route->getMethod()) { - case 'GET': - $queries[$name] = $field; - break; - case 'POST': - case 'PUT': - case 'PATCH': - case 'DELETE': - $mutations[$name] = $field; - break; - default: - throw new \Exception("Unsupported method: {$route->getMethod()}"); + foreach (Mapper::route($utopia, $route, $complexity) as $field) { + switch ($route->getMethod()) { + case 'GET': + $queries[$name] = $field; + break; + case 'POST': + case 'PUT': + case 'PATCH': + case 'DELETE': + $mutations[$name] = $field; + break; + default: + throw new \Exception("Unsupported method: {$route->getMethod()}"); + } } } } From 469732f482e80044b6a5128ed803ba8207311875 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 14:34:53 +0900 Subject: [PATCH 086/161] Address Comments --- app/controllers/general.php | 5 ++ app/http.php | 6 -- composer.lock | 122 +++++++++++++------------- src/Appwrite/GraphQL/Schema.php | 2 +- src/Appwrite/GraphQL/Types/Mapper.php | 29 +++--- 5 files changed, 83 insertions(+), 81 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 5457f310b3..1190f90fb0 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1128,3 +1128,8 @@ App::wildcard() foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } + +// Check for any errors found while we were initialising the SDK Methods. +if (!empty(Method::getErrors())) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); +} diff --git a/app/http.php b/app/http.php index 1ef4dcd282..641143694d 100644 --- a/app/http.php +++ b/app/http.php @@ -2,7 +2,6 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Swoole\Constant; @@ -336,9 +335,4 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); -// Check for any errors found while we were initialising the SDK Methods. -if (!empty(Method::getErrors())) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); -} - $http->start(); diff --git a/composer.lock b/composer.lock index e42376d236..1b80f15aea 100644 --- a/composer.lock +++ b/composer.lock @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.29.2", + "version": "v4.29.3", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945" + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/79aa5014efeeec3d137df5cdb0ae2fc163953945", - "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.2" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3" }, - "time": "2024-12-18T14:11:12+00:00" + "time": "2025-01-08T21:00:13+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1237,16 +1237,16 @@ }, { "name": "open-telemetry/api", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed" + "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", - "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/351a30baa79699de3de3a814c8ccc7b52ccdfb1d", + "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d", "shasum": "" }, "require": { @@ -1303,7 +1303,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-11-16T04:32:30+00:00" + "time": "2025-01-08T23:50:34+00:00" }, { "name": "open-telemetry/context", @@ -1366,16 +1366,16 @@ }, { "name": "open-telemetry/exporter-otlp", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18" + "reference": "243d9657c44a06f740cf384f486afe954c2b725f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18", - "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/243d9657c44a06f740cf384f486afe954c2b725f", + "reference": "243d9657c44a06f740cf384f486afe954c2b725f", "shasum": "" }, "require": { @@ -1426,20 +1426,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-04-30T18:28:30+00:00" + "time": "2025-01-08T23:50:03+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", - "version": "1.2.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/585bafddd4ae6565de154610b10a787a455c9ba0", + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0", "shasum": "" }, "require": { @@ -1489,20 +1489,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-30T11:49:49+00:00" + "time": "2025-01-15T23:07:07+00:00" }, { "name": "open-telemetry/sdk", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b" + "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b", - "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/9a1c3b866239dbff291e5cc555bb7793eab08127", + "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127", "shasum": "" }, "require": { @@ -1579,7 +1579,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-18T21:01:35+00:00" + "time": "2025-01-08T23:50:34+00:00" }, { "name": "open-telemetry/sem-conv", @@ -2453,16 +2453,16 @@ }, { "name": "symfony/http-client", - "version": "v7.2.1", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e" + "reference": "339ba21476eb184290361542f732ad12c97591ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/ff4df2b68d1c67abb9fef146e6540ea16b58d99e", - "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e", + "url": "https://api.github.com/repos/symfony/http-client/zipball/339ba21476eb184290361542f732ad12c97591ec", + "reference": "339ba21476eb184290361542f732ad12c97591ec", "shasum": "" }, "require": { @@ -2528,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.1" + "source": "https://github.com/symfony/http-client/tree/v7.2.2" }, "funding": [ { @@ -2544,7 +2544,7 @@ "type": "tidelift" } ], - "time": "2024-12-07T08:50:44+00:00" + "time": "2024-12-30T18:35:15+00:00" }, { "name": "symfony/http-client-contracts", @@ -3929,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.13", + "version": "0.6.14", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" + "reference": "59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", - "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2", + "reference": "59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2", "shasum": "" }, "require": { @@ -3979,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.13" + "source": "https://github.com/utopia-php/migration/tree/0.6.14" }, - "time": "2024-11-26T13:57:53+00:00" + "time": "2025-01-08T01:07:25+00:00" }, { "name": "utopia-php/mongo", @@ -4095,16 +4095,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.1", + "version": "0.7.2", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a" + "reference": "6f9243848f1c6466f6509fd01c7e18306a6d8caf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/3433a0f1a54988f2a59c735f507745cb2c24638a", - "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/6f9243848f1c6466f6509fd01c7e18306a6d8caf", + "reference": "6f9243848f1c6466f6509fd01c7e18306a6d8caf", "shasum": "" }, "require": { @@ -4139,9 +4139,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.1" + "source": "https://github.com/utopia-php/platform/tree/0.7.2" }, - "time": "2024-10-22T10:27:49+00:00" + "time": "2025-01-15T05:56:26+00:00" }, { "name": "utopia-php/pools", @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.28", + "version": "0.39.29", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "6ff467858fe418e364460da905139216570a5d5e" + "reference": "a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6ff467858fe418e364460da905139216570a5d5e", - "reference": "6ff467858fe418e364460da905139216570a5d5e", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7", + "reference": "a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7", "shasum": "" }, "require": { @@ -4852,9 +4852,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.28" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.29" }, - "time": "2024-12-30T11:17:25+00:00" + "time": "2025-01-07T05:28:35+00:00" }, { "name": "doctrine/annotations", @@ -5126,16 +5126,16 @@ }, { "name": "laravel/pint", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0" + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/8169513746e1bac70c85d6ea1524d9225d4886f0", - "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0", + "url": "https://api.github.com/repos/laravel/pint/zipball/53072e8ea22213a7ed168a8a15b96fbb8b82d44b", + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b", "shasum": "" }, "require": { @@ -5188,7 +5188,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-12-30T16:20:10+00:00" + "time": "2025-01-14T16:20:53+00:00" }, { "name": "matthiasmullie/minify", @@ -7735,16 +7735,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -7779,7 +7779,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.0" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -7795,7 +7795,7 @@ "type": "tidelift" } ], - "time": "2024-10-23T06:56:12+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 9214bf8e20..a0d93de45c 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -114,7 +114,7 @@ class Schema $methodName = $method->getMethodName(); $name = $namespace . \ucfirst($methodName); - foreach (Mapper::route($utopia, $route, $complexity) as $field) { + foreach (Mapper::route($utopia, $route, $method, $complexity) as $field) { switch ($route->getMethod()) { case 'GET': $queries[$name] = $field; diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 4bad3e968f..e5056d0abc 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -4,6 +4,7 @@ namespace Appwrite\GraphQL\Types; use Appwrite\GraphQL\Resolvers; use Appwrite\GraphQL\Types; +use Appwrite\SDK\Method; use Exception; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; @@ -78,6 +79,7 @@ class Mapper public static function route( App $utopia, Route $route, + Method $method, callable $complexity ): iterable { foreach (self::$blacklist as $blacklist) { @@ -86,18 +88,7 @@ class Mapper } } - $sdk = $route->getLabel('sdk', false); - - if (!$sdk) { - return; - } - - if (is_array($sdk)) { - $sdk = $sdk[0]; - } - - /** @var \Appwrite\SDK\Method $sdk */ - $responses = $sdk->getResponses() ?? []; + $responses = $method->getResponses() ?? []; // If responses is an array, map each response to its model if (\is_array($responses)) { @@ -126,13 +117,25 @@ class Mapper $list = false; foreach ($route->getParams() as $name => $parameter) { + $methodParameters = $method->getParameters(); + + if (!empty($methodParameters)) { + if (!array_key_exists($name, $methodParameters)) { + continue; + } + $optional = $methodParameters[$name]['optional']; + } else { + $optional = $parameter['optional']; + } + if ($name === 'queries') { $list = true; } + $parameterType = Mapper::param( $utopia, $parameter['validator'], - !$parameter['optional'], + !$optional, $parameter['injections'] ); $params[$name] = [ From e0101def27ca5a4cf9f295376acd1df3a5d1bb5a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 17:47:36 +0900 Subject: [PATCH 087/161] Fix tests --- app/controllers/api/databases.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 093ba7898b..a96fb1fe66 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3109,6 +3109,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ + 'databaseId' => ['optional' => false], + 'collectionId' => ['optional' => false], 'documentId' => ['optional' => false], 'data' => ['optional' => false], 'permissions' => ['optional' => true], @@ -3127,6 +3129,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ + 'databaseId' => ['optional' => false], + 'collectionId' => ['optional' => false], 'documents' => ['optional' => false], ] ) From 26473795579cc8a75ab39a810881234bdb05bf1b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 23 Jan 2025 13:24:56 +0900 Subject: [PATCH 088/161] Fix missing dependency --- composer.json | 1 + composer.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b13dd3e22e..9674bce2fd 100644 --- a/composer.json +++ b/composer.json @@ -45,6 +45,7 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.16.*", "appwrite/php-clamav": "2.0.*", + "utopia-php/abuse": "0.47.*", "utopia-php/analytics": "0.10.*", "utopia-php/audit": "0.47.*", "utopia-php/cache": "0.11.*", diff --git a/composer.lock b/composer.lock index 268ba449ec..cd14e512a7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e2050a253319ce2c068e000ba5787d74", + "content-hash": "3cd37ea04612e04b9e76eb51c5da41dd", "packages": [ { "name": "adhocore/jwt", @@ -3134,6 +3134,57 @@ }, "time": "2023-04-05T11:54:14+00:00" }, + { + "name": "utopia-php/abuse", + "version": "0.47.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/abuse.git", + "reference": "2b52bb362234d4072b647ed57db1b3be030f57c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/2b52bb362234d4072b647ed57db1b3be030f57c2", + "reference": "2b52bb362234d4072b647ed57db1b3be030f57c2", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-pdo": "*", + "ext-redis": "*", + "php": ">=8.0", + "utopia-php/database": "0.56.*" + }, + "require-dev": { + "laravel/pint": "1.5.*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Abuse\\": "src/Abuse" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple abuse library to manage application usage limits", + "keywords": [ + "Abuse", + "framework", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/abuse/issues", + "source": "https://github.com/utopia-php/abuse/tree/0.47.0" + }, + "time": "2025-01-15T02:41:02+00:00" + }, { "name": "utopia-php/analytics", "version": "0.10.2", From a6f459eccad0a6f23a0d8f6ddcb9fe59f8abae7f Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 24 Jan 2025 14:26:17 +0900 Subject: [PATCH 089/161] Cleanup a few leftover from development --- docs/references/health/get-version.md | 1 - package-lock.json | 10 ---------- src/Appwrite/Messaging/Adapter/Realtime.php | 2 -- 3 files changed, 13 deletions(-) delete mode 100644 docs/references/health/get-version.md delete mode 100644 package-lock.json diff --git a/docs/references/health/get-version.md b/docs/references/health/get-version.md deleted file mode 100644 index 4247ecdaed..0000000000 --- a/docs/references/health/get-version.md +++ /dev/null @@ -1 +0,0 @@ -Get the version of Appwrite that this instance is currently running. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 6ab33b14fe..0000000000 --- a/package-lock.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@appwrite.io/repo", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@appwrite.io/repo" - } - } -} diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index cd3dcc57c0..dceafacf6e 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -3,7 +3,6 @@ namespace Appwrite\Messaging\Adapter; use Appwrite\Messaging\Adapter; -use Utopia\CLI\Console; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; @@ -133,7 +132,6 @@ class Realtime extends Adapter public static function send(string $projectId, array $payload, array $events, array $channels, array $roles, array $options = []): void { if (empty($channels) || empty($roles) || empty($projectId)) { - Console::error('Missing required parameters for Realtime event'); return; } From 5dadd8caea0965e2cf1a4c464170963a7feeca41 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 24 Jan 2025 16:19:43 +0900 Subject: [PATCH 090/161] Fix required/whitelist system and descriptions --- app/config/specs/open-api3-latest-client.json | 28 +++++++++++++++++-- .../specs/open-api3-latest-console.json | 28 +++++++++++++++++-- app/config/specs/open-api3-latest-server.json | 28 +++++++++++++++++-- app/config/specs/swagger2-latest-client.json | 27 ++++++++++++++++-- app/config/specs/swagger2-latest-console.json | 27 ++++++++++++++++-- app/config/specs/swagger2-latest-server.json | 27 ++++++++++++++++-- .../Specification/Format/OpenAPI3.php | 12 ++++---- .../Specification/Format/Swagger2.php | 12 ++++---- 8 files changed, 165 insertions(+), 24 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 55b7f590ab..4a93fa40d8 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4396,7 +4396,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -4414,7 +4437,8 @@ "code": 201, "model": "#\/components\/schemas\/documentList" } - ] + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 80e7b4aa48..5b26aaabc2 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -7854,7 +7854,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -7872,7 +7895,8 @@ "code": 201, "model": "#\/components\/schemas\/documentList" } - ] + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index a2ba79a6b9..5af2594a0e 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7412,7 +7412,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -7430,7 +7453,8 @@ "code": 201, "model": "#\/components\/schemas\/documentList" } - ] + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 564b2953a1..42fa5e9a61 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4574,7 +4574,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -4593,7 +4616,7 @@ "model": "#\/definitions\/documentList" } ], - "description": "\/docs\/references\/databases\/create-document.md" + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 9bd031b562..de0118aca8 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8039,7 +8039,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -8058,7 +8081,7 @@ "model": "#\/definitions\/documentList" } ], - "description": "\/docs\/references\/databases\/create-document.md" + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index b29b790160..a787aa26d2 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7579,7 +7579,30 @@ "server" ], "packaging": false, - "additional-methods": [ + "methods": [ + { + "name": "createDocument", + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, { "name": "createDocuments", "parameters": [ @@ -7598,7 +7621,7 @@ "model": "#\/definitions\/documentList" } ], - "description": "\/docs\/references\/databases\/create-document.md" + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index bd5405539d..847dfd8eff 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -131,10 +131,8 @@ class OpenAPI3 extends Format $additionalMethods = null; if (is_array($sdk)) { - $mainSdk = array_shift($sdk); $additionalMethods = $sdk; - - $sdk = $mainSdk; + $sdk = $sdk[0]; } /** @@ -202,14 +200,16 @@ class OpenAPI3 extends Format if (!empty($additionalMethods)) { - $temp['x-appwrite']['additional-methods'] = []; + $temp['x-appwrite']['methods'] = []; foreach ($additionalMethods as $method) { /** @var \Appwrite\SDK\Method $method */ + $desc = $method->getDescriptionFilePath(); $additionalMethod = [ 'name' => $method->getMethodName(), 'parameters' => [], 'required' => [], - 'responses' => [] + 'responses' => [], + 'description' => ($desc) ? \file_get_contents($desc) : '', ]; foreach ($method->getParameters() as $name => $param) { @@ -228,7 +228,7 @@ class OpenAPI3 extends Format ]; } - $temp['x-appwrite']['additional-methods'][] = $additionalMethod; + $temp['x-appwrite']['methods'][] = $additionalMethod; } } diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7277e3ab2b..c3f37cb33a 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -130,10 +130,8 @@ class Swagger2 extends Format $additionalMethods = null; if (is_array($sdk)) { - $mainSdk = array_shift($sdk); $additionalMethods = $sdk; - - $sdk = $mainSdk; + $sdk = $sdk[0]; } $consumes = [$sdk->getRequestType()]; @@ -203,15 +201,17 @@ class Swagger2 extends Format } if (!empty($additionalMethods)) { - $temp['x-appwrite']['additional-methods'] = []; + $temp['x-appwrite']['methods'] = []; foreach ($additionalMethods as $method) { /** @var \Appwrite\SDK\Method $method */ + $desc = $method->getDescriptionFilePath(); + $additionalMethod = [ 'name' => $method->getMethodName(), 'parameters' => [], 'required' => [], 'responses' => [], - 'description' => $method->getDescription(), + 'description' => ($desc) ? \file_get_contents($desc) : '', ]; foreach ($method->getParameters() as $name => $param) { @@ -230,7 +230,7 @@ class Swagger2 extends Format ]; } - $temp['x-appwrite']['additional-methods'][] = $additionalMethod; + $temp['x-appwrite']['methods'][] = $additionalMethod; } } From bd20ea03006c5ec32ded29e5a0910e3cc84727aa Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 30 Jan 2025 14:19:20 +0900 Subject: [PATCH 091/161] Fix additional methods with multiple responses --- composer.json | 10 +- composer.lock | 138 +++++++----------- .../Specification/Format/OpenAPI3.php | 15 +- .../Specification/Format/Swagger2.php | 15 +- 4 files changed, 81 insertions(+), 97 deletions(-) diff --git a/composer.json b/composer.json index e024cff1c6..9229069ed7 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,7 @@ }, "require-dev": { "ext-fileinfo": "*", - "appwrite/sdk-generator": "0.39.30", + "appwrite/sdk-generator": "dev-feat-route-muliplexing", "phpunit/phpunit": "9.5.20", "swoole/ide-helper": "5.1.2", "textalk/websocket": "1.5.7", @@ -102,5 +102,11 @@ "php-http/discovery": false, "tbachert/spi": false } - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/appwrite/sdk-generator" + } + ] } diff --git a/composer.lock b/composer.lock index 02c3b65284..71941306d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8927ec7d3cfa460ce223e4c13cf61ada", + "content-hash": "8d4fd5bdfabe078516c5f9e3289a73ea", "packages": [ { "name": "adhocore/jwt", @@ -1237,16 +1237,16 @@ }, { "name": "open-telemetry/api", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d" + "reference": "74b1a03263be8c5acb578f41da054b4bac3af4a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/351a30baa79699de3de3a814c8ccc7b52ccdfb1d", - "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/74b1a03263be8c5acb578f41da054b4bac3af4a0", + "reference": "74b1a03263be8c5acb578f41da054b4bac3af4a0", "shasum": "" }, "require": { @@ -1303,7 +1303,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-01-08T23:50:34+00:00" + "time": "2025-01-20T23:35:16+00:00" }, { "name": "open-telemetry/context", @@ -1493,16 +1493,16 @@ }, { "name": "open-telemetry/sdk", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127" + "reference": "96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/9a1c3b866239dbff291e5cc555bb7793eab08127", - "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1", + "reference": "96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1", "shasum": "" }, "require": { @@ -1579,7 +1579,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-01-08T23:50:34+00:00" + "time": "2025-01-09T23:17:14+00:00" }, { "name": "open-telemetry/sem-conv", @@ -2453,16 +2453,16 @@ }, { "name": "symfony/http-client", - "version": "v7.2.2", + "version": "v7.2.3", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "339ba21476eb184290361542f732ad12c97591ec" + "reference": "7ce6078c79a4a7afff931c413d2959d3bffbfb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/339ba21476eb184290361542f732ad12c97591ec", - "reference": "339ba21476eb184290361542f732ad12c97591ec", + "url": "https://api.github.com/repos/symfony/http-client/zipball/7ce6078c79a4a7afff931c413d2959d3bffbfb8d", + "reference": "7ce6078c79a4a7afff931c413d2959d3bffbfb8d", "shasum": "" }, "require": { @@ -2528,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.2" + "source": "https://github.com/symfony/http-client/tree/v7.2.3" }, "funding": [ { @@ -2544,7 +2544,7 @@ "type": "tidelift" } ], - "time": "2024-12-30T18:35:15+00:00" + "time": "2025-01-28T15:51:35+00:00" }, { "name": "symfony/http-client-contracts", @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.30", + "version": "dev-feat-route-muliplexing", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "830198d501f51163514305befefb775106a7198b" + "reference": "31ee84580da190a6b8b35b044c7411fbcddcbf3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/830198d501f51163514305befefb775106a7198b", - "reference": "830198d501f51163514305befefb775106a7198b", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/31ee84580da190a6b8b35b044c7411fbcddcbf3d", + "reference": "31ee84580da190a6b8b35b044c7411fbcddcbf3d", "shasum": "" }, "require": { @@ -4839,7 +4839,22 @@ "Appwrite\\Spec\\": "src/Spec" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ], + "lint": [ + "vendor/bin/phpcs" + ], + "format": [ + "vendor/bin/phpcbf" + ] + }, "license": [ "MIT" ], @@ -4851,10 +4866,10 @@ ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { - "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.30" + "source": "https://github.com/appwrite/sdk-generator/tree/feat-route-muliplexing", + "issues": "https://github.com/appwrite/sdk-generator/issues" }, - "time": "2025-01-20T06:10:03+00:00" + "time": "2025-01-30T03:30:12+00:00" }, { "name": "doctrine/annotations", @@ -5601,70 +5616,18 @@ }, "time": "2023-10-30T13:38:26+00:00" }, - { - "name": "phpbench/dom", - "version": "0.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpbench/dom.git", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.3||^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.14", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.0||^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\Dom\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "DOM wrapper to simplify working with the PHP DOM implementation", - "support": { - "issues": "https://github.com/phpbench/dom/issues", - "source": "https://github.com/phpbench/dom/tree/0.3.3" - }, - "abandoned": true, - "time": "2023-03-06T23:46:57+00:00" - }, { "name": "phpbench/phpbench", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0" + "reference": "4248817222514421cba466bfa7adc7d8932345d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/4248817222514421cba466bfa7adc7d8932345d4", + "reference": "4248817222514421cba466bfa7adc7d8932345d4", "shasum": "" }, "require": { @@ -5677,7 +5640,6 @@ "ext-tokenizer": "*", "php": "^8.1", "phpbench/container": "^2.2", - "phpbench/dom": "~0.3.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "seld/jsonlint": "^1.1", "symfony/console": "^6.1 || ^7.0", @@ -5696,8 +5658,8 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.4", - "rector/rector": "^0.18.11 || ^1.0.0", + "phpunit/phpunit": "^10.4 || ^11.0", + "rector/rector": "^1.2", "symfony/error-handler": "^6.1 || ^7.0", "symfony/var-dumper": "^6.1 || ^7.0" }, @@ -5742,7 +5704,7 @@ ], "support": { "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.3.1" + "source": "https://github.com/phpbench/phpbench/tree/1.4.0" }, "funding": [ { @@ -5750,7 +5712,7 @@ "type": "github" } ], - "time": "2024-06-30T11:04:37+00:00" + "time": "2025-01-26T19:54:45+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -8556,7 +8518,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "appwrite/sdk-generator": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 847dfd8eff..84feb6adcc 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -222,10 +222,17 @@ class OpenAPI3 extends Format foreach ($method->getResponses() as $response) { /** @var \Appwrite\SDK\Response $response */ - $additionalMethod['responses'][] = [ - 'code' => $response->getCode(), - 'model' => '#/components/schemas/' . $response->getModel() - ]; + if (\is_array($response->getModel())) { + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => \array_map(fn ($m) => '#/components/schemas/' . $m, $response->getModel()) + ]; + } else { + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => '#/components/schemas/' . $response->getModel() + ]; + } } $temp['x-appwrite']['methods'][] = $additionalMethod; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index c3f37cb33a..73b7cec923 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -224,10 +224,17 @@ class Swagger2 extends Format foreach ($method->getResponses() as $response) { /** @var \Appwrite\SDK\Response $response */ - $additionalMethod['responses'][] = [ - 'code' => $response->getCode(), - 'model' => '#/definitions/' . $response->getModel() - ]; + if (\is_array($response->getModel())) { + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => \array_map(fn ($m) => '#/definitions/' . $m, $response->getModel()) + ]; + } else { + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => '#/definitions/' . $response->getModel() + ]; + } } $temp['x-appwrite']['methods'][] = $additionalMethod; From a8a5b4d00c46b4528bd4859c4874004449189511 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 11 Feb 2025 09:24:18 +0900 Subject: [PATCH 092/161] Update docs/references/databases/update-documents.md Co-authored-by: Jake Barnby --- docs/references/databases/update-documents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/databases/update-documents.md b/docs/references/databases/update-documents.md index f04ec420f8..5f560c6435 100644 --- a/docs/references/databases/update-documents.md +++ b/docs/references/databases/update-documents.md @@ -1 +1 @@ -Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated. \ No newline at end of file +Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. \ No newline at end of file From 709f616f7f7ad0f8b509e02741317a288242b814 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 11 Feb 2025 09:24:26 +0900 Subject: [PATCH 093/161] Update app/controllers/api/databases.php Co-authored-by: Jake Barnby --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 9ab779b355..2d5f17f97b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3178,7 +3178,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } if (!empty($documents) && !empty($documentId)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, use $id inside the documents'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, set $id in each document'); } if (!empty($data)) { From d49087961579cc97a6dd487368934298a042782f Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 11 Feb 2025 09:24:35 +0900 Subject: [PATCH 094/161] Update app/controllers/api/databases.php Co-authored-by: Jake Barnby --- app/controllers/api/databases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 2d5f17f97b..86d7cc0eeb 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3339,7 +3339,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $document['$id'] = $documentId == 'unique()' ? ID::unique() : $documentId; } else { if (empty($document['$id'])) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, '$id is required inside documents when creating bulk documents'); + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, '$id must be set in each document when creating bulk documents'); } $document['$id'] = $document['$id'] == 'unique()' ? ID::unique() : $document['$id']; From 0ccaf9adffa4e8e9068acc5a21018e1bdb67e0fb Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 11 Feb 2025 15:57:27 +0900 Subject: [PATCH 095/161] Add more benchmarks --- tests/benchmarks/bulk-operations.js | 32 -- .../bulk-operations/documentCreation.js | 82 +++++ .../bulk-operations/noisyNeighbor.js | 144 ++++++++ tests/benchmarks/bulk-operations/utils.js | 336 ++++++++++++++++++ 4 files changed, 562 insertions(+), 32 deletions(-) delete mode 100644 tests/benchmarks/bulk-operations.js create mode 100644 tests/benchmarks/bulk-operations/documentCreation.js create mode 100644 tests/benchmarks/bulk-operations/noisyNeighbor.js create mode 100644 tests/benchmarks/bulk-operations/utils.js diff --git a/tests/benchmarks/bulk-operations.js b/tests/benchmarks/bulk-operations.js deleted file mode 100644 index a60129735a..0000000000 --- a/tests/benchmarks/bulk-operations.js +++ /dev/null @@ -1,32 +0,0 @@ -import { check } from "k6"; -import http from "k6/http"; - -const amount = 100_000; -const databaseId = "674918b20017411b94b2"; -const collectionId = "674918b4002b46c47d5d"; - -const documents = Array(amount).fill({ - $id: "unique()", - name: "asd", -}); - -export default function () { - const payload = JSON.stringify({ - documents, - }); - - const res = http.post(`http://localhost/v1/databases/${databaseId}/collections/${collectionId}/documents`, - payload, - { - headers: { - "X-Appwrite-Key": "standard_fa89c4834660f39e95ca2c2996fe7dd4ff498725e37c09323234c009570c1719f1c10610bf3541cf9ead120c107e41397a4eae1c787c83bdf577857bbc5963341641c77f582cc41e11a0d50eb4c2e4b1fda74418a8b9a253d6e63008e33560ba35310b9dc2fed5f09ca599e646f744cc6308b8ccd27ff04f9e498ec5a5f2c3db", - "X-Appwrite-Project": "674818bc0017934d58dd", - "Content-Type": "application/json", - }, - } - ); - - check(res, { - "status is 200": (r) => r.status === 201, - }); -} diff --git a/tests/benchmarks/bulk-operations/documentCreation.js b/tests/benchmarks/bulk-operations/documentCreation.js new file mode 100644 index 0000000000..730b6bb541 --- /dev/null +++ b/tests/benchmarks/bulk-operations/documentCreation.js @@ -0,0 +1,82 @@ +import { check, sleep } from "k6"; +import http from "k6/http"; +import { provisionProject, provisionDatabase, cleanup, unique } from "./utils.js"; + +const amount = 10_000; + +export function setup() { + const resources = provisionProject({ + endpoint: 'http://localhost/v1', + email: 'test@test.com', + password: 'password123', + name: 'Test User', + projectName: 'Bulk Operations Test' + }); + + const { databaseId, collectionId } = provisionDatabase({ + endpoint: 'http://localhost/v1', + apiHeaders: resources.apiHeaders + }); + + sleep(3); // Await Attributes to be provisioned + + console.log(`----- Amount of documents: ${amount} -----`); + + return { + databaseId, + collectionId, + apiHeaders: resources.apiHeaders, + resources + }; +} + +export function teardown(data) { + cleanup(data.resources); +} + +let documents = Array(amount).fill({ + $id: "unique()", + name: "asd", +}); + +documents = documents.map((document) => { + return { + ...document, + age: Math.floor(Math.random() * 100), + email: `${unique()}@test.com`, + height: Math.random() * 100, + }; +}); + +export default function (data) { + const payload = JSON.stringify({ + documents, + }); + + const res = http.post( + `http://localhost/v1/databases/${data.databaseId}/collections/${data.collectionId}/documents`, + payload, + { + headers: data.apiHeaders + } + ); + + check(res, { + "status is 201": (r) => r.status === 201, + }); + + return { + resources: data.resources + }; +} + +export const options = { + scenarios: { + bulk_create: { + executor: 'per-vu-iterations', + vus: 1, + iterations: 20, + exec: 'default' + } + } +}; diff --git a/tests/benchmarks/bulk-operations/noisyNeighbor.js b/tests/benchmarks/bulk-operations/noisyNeighbor.js new file mode 100644 index 0000000000..4bfec4e564 --- /dev/null +++ b/tests/benchmarks/bulk-operations/noisyNeighbor.js @@ -0,0 +1,144 @@ +import { check, sleep } from "k6"; +import http from "k6/http"; +import { Trend } from "k6/metrics"; +import { provisionProject, provisionDatabase, cleanup, unique } from "./utils.js"; + +// Custom Trend metric for light response time tracking +export const lightResponseTime = new Trend("light_response_time", true); + +const BULK_AMOUNT = 100_000; // Heavy operation amount +const LIGHT_AMOUNT = 10; // Light operation amount + +export function setup() { + // Set up two separate projects - one for bulk operations (noisy neighbor) and one for light operations + const heavyResources = provisionProject({ + endpoint: 'http://localhost/v1', + email: 'heavy@test.com', + password: 'password123', + name: 'Heavy User', + projectName: 'Noisy Neighbor - Heavy' + }); + + const lightResources = provisionProject({ + endpoint: 'http://localhost/v1', + email: 'light@test.com', + password: 'password123', + name: 'Light User', + projectName: 'Noisy Neighbor - Light' + }); + + // Set up databases for both projects + const heavy = provisionDatabase({ + endpoint: 'http://localhost/v1', + apiHeaders: heavyResources.apiHeaders + }); + + const light = provisionDatabase({ + endpoint: 'http://localhost/v1', + apiHeaders: lightResources.apiHeaders + }); + + sleep(3); // Await Attributes to be provisioned + + console.log(`----- Heavy operations: ${BULK_AMOUNT} documents | Light operations: ${LIGHT_AMOUNT} document -----`); + + return { + heavy: { + databaseId: heavy.databaseId, + collectionId: heavy.collectionId, + apiHeaders: heavyResources.apiHeaders, + resources: heavyResources + }, + light: { + databaseId: light.databaseId, + collectionId: light.collectionId, + apiHeaders: lightResources.apiHeaders, + resources: lightResources + } + }; +} + +export function teardown(data) { + cleanup(data.heavy.resources); + cleanup(data.light.resources); +} + +// Create document payloads +function createDocuments(amount) { + let documents = Array(amount).fill({ + $id: "unique()", + name: "test", + }); + + return documents.map((document) => ({ + ...document, + age: Math.floor(Math.random() * 100), + email: `${unique()}@test.com`, + height: Math.random() * 100, + })); +} + +// Heavy operation function +export function heavy(data) { + const documents = createDocuments(BULK_AMOUNT); + const payload = JSON.stringify({ documents }); + + const res = http.post( + `http://localhost/v1/databases/${data.heavy.databaseId}/collections/${data.heavy.collectionId}/documents`, + payload, + { + headers: data.heavy.apiHeaders + } + ); + + check(res, { + "heavy operation status is 201": (r) => r.status === 201, + }); +} + +// Light operation function +export function light(data) { + const documents = createDocuments(LIGHT_AMOUNT); + const payload = JSON.stringify({ documents }); + + const startTime = new Date(); + const res = http.post( + `http://localhost/v1/databases/${data.light.databaseId}/collections/${data.light.collectionId}/documents`, + payload, + { + headers: data.light.apiHeaders + } + ); + const duration = new Date() - startTime; + + // Record the light operation response time using the custom Trend metric + lightResponseTime.add(duration); + + check(res, { + "light operation status is 201": (r) => r.status === 201, + }); +} + +export const options = { + scenarios: { + // Heavy bulk operations running continuously + heavy_load: { + executor: 'constant-vus', + vus: 5, + duration: '30s', + exec: 'heavy' + }, + // Light operations to measure impact + light_operations: { + executor: 'constant-arrival-rate', + rate: 5, + timeUnit: '1s', + duration: '30s', + preAllocatedVUs: 10, + exec: 'light' + } + }, + thresholds: { + http_req_duration: ['p(95)<2000'], // 95% of requests should complete within 2s + } +}; \ No newline at end of file diff --git a/tests/benchmarks/bulk-operations/utils.js b/tests/benchmarks/bulk-operations/utils.js new file mode 100644 index 0000000000..dc8dcac569 --- /dev/null +++ b/tests/benchmarks/bulk-operations/utils.js @@ -0,0 +1,336 @@ +import http from 'k6/http'; +import { check } from 'k6'; + +/** + * @typedef {Object} AuthHeaders + * @property {string} 'Content-Type' - Content type header + * @property {string} 'Cookie' - Session cookie + * @property {string} 'X-Appwrite-Project' - Project ID header + */ + +/** + * @typedef {Object} ApiHeaders + * @property {string} 'Content-Type' - Content type header + * @property {string} 'X-Appwrite-Project' - Project ID header + * @property {string} 'X-Appwrite-Key' - API key header + */ + +/** + * @typedef {Object} ProvisionedResources + * @property {string} userId - The ID of the created user + * @property {string} teamId - The ID of the created team + * @property {string} projectId - The ID of the created project + * @property {string} cookies - Session cookies for authentication + * @property {AuthHeaders} headers - Headers for cookie-based authentication + * @property {string} apiKey - The API key secret + * @property {ApiHeaders} apiHeaders - Headers for API key authentication + */ + +function assert(response, checkName, condition) { + const result = check(response, { + [checkName]: condition + }); + if (!result) { + console.error(`Assertion failed: ${checkName}`); + console.error(`Response status: ${response.status}`); + console.error(`Response body: ${response.body}`); + throw new Error(`Assertion failed: ${checkName}`); + } +} + +/** + * Provisions an Appwrite project setup including: + * - Account creation + * - Session creation + * - Team creation + * - Project creation + * - API Key creation + * + * @param {Object} config Configuration object + * @param {string} config.endpoint Base endpoint URL (e.g., 'http://localhost:80/v1') + * @param {string} config.email Email for account creation + * @param {string} config.password Password for account creation + * @param {string} config.name Name for account creation + * @param {string} config.projectName Name for the project + * @returns {ProvisionedResources} Object containing all created resource IDs and session information + */ +export function provisionProject(config) { + const { + endpoint, + email, + password, + name, + projectName, + } = config; + + // Step 1: Create Account + const accountResponse = http.post(`${endpoint}/account`, JSON.stringify({ + userId: 'unique()', + email, + password, + name + }), { + headers: { + 'Content-Type': 'application/json', + } + }); + + assert(accountResponse, 'account created successfully', (r) => r.status === 201 || r.status === 409); + + const userId = accountResponse.json('$id'); + + // Step 2: Create Session + const sessionResponse = http.post(`${endpoint}/account/sessions/email`, JSON.stringify({ + email, + password + }), { + headers: { + 'Content-Type': 'application/json', + } + }); + + assert(sessionResponse, 'session created successfully', (r) => r.status === 201); + + // Keep manual control of the cookies to allow for simultaneous requests + const jar = http.cookieJar(); + jar.clear(`${endpoint}`); + + // Extract cookies for subsequent requests + const cookies = sessionResponse.headers['Set-Cookie']; + + // Common headers for authenticated requests + const authHeaders = { + 'Content-Type': 'application/json', + 'Cookie': cookies + }; + + // Step 3: Create Team + const teamResponse = http.post(`${endpoint}/teams`, JSON.stringify({ + teamId: 'unique()', + name: `${projectName} Team` + }), { + headers: authHeaders + }); + + assert(teamResponse, 'team created successfully', (r) => r.status === 201); + + const teamId = teamResponse.json('$id'); + + // Step 4: Create Project + const projectResponse = http.post(`${endpoint}/projects`, JSON.stringify({ + projectId: 'unique()', + name: projectName, + teamId: teamId + }), { + headers: authHeaders + }); + + assert(projectResponse, 'project created successfully', (r) => r.status === 201); + + const projectId = projectResponse.json('$id'); + + // Step 5: Create API Key + const apiKeyResponse = http.post(`${endpoint}/projects/${projectId}/keys`, JSON.stringify({ + name: 'Test API Key', + scopes: SCOPES, // All permissions + }), { + headers: authHeaders + }); + + assert(apiKeyResponse, 'api key created successfully', (r) => r.status === 201); + + const apiKey = apiKeyResponse.json('secret'); + + // Create a new headers object for API key authentication + const apiHeaders = { + 'Content-Type': 'application/json', + 'X-Appwrite-Project': projectId, + 'X-Appwrite-Key': apiKey + }; + + // Return all created resources and session info + return { + endpoint, + userId, + teamId, + projectId, + cookies, + headers: authHeaders, + apiKey, + apiHeaders + }; +} + +/** + * Example usage: + * + * const config = { + * endpoint: 'http://localhost:80/v1', + * email: 'test@example.com', + * password: 'complex-password', + * name: 'Test User', + * projectName: 'Test Project' + * }; + * + * const resources = provisionProject(config); + */ + +const SCOPES = [ + "sessions.write", + "users.read", + "users.write", + "teams.read", + "teams.write", + "databases.read", + "databases.write", + "collections.read", + "collections.write", + "attributes.read", + "attributes.write", + "indexes.read", + "indexes.write", + "documents.read", + "documents.write", + "files.read", + "files.write", + "buckets.read", + "buckets.write", + "functions.read", + "functions.write", + "execution.read", + "execution.write", + "targets.read", + "targets.write", + "providers.read", + "providers.write", + "messages.read", + "messages.write", + "topics.read", + "topics.write", + "subscribers.read", + "subscribers.write", + "locale.read", + "avatars.read", + "health.read", + "migrations.read", + "migrations.write" +] + +export function provisionDatabase(config) { + const { + endpoint, + apiHeaders + } = config; + + // Create database + const databaseResponse = http.post( + `${endpoint}/databases`, + JSON.stringify({ + databaseId: 'unique()', + name: 'Bulk Test DB' + }), + { headers: apiHeaders } + ); + + assert(databaseResponse, 'database created successfully', (r) => r.status === 201); + + const databaseId = databaseResponse.json('$id'); + + // Create collection + const collectionResponse = http.post( + `${endpoint}/databases/${databaseId}/collections`, + JSON.stringify({ + collectionId: 'unique()', + name: 'Bulk Test Collection', + permissions: ['read("any")', 'write("any")'], + documentSecurity: false + }), + { headers: apiHeaders } + ); + + assert(collectionResponse, 'collection created successfully', (r) => r.status === 201); + + const collectionId = collectionResponse.json('$id'); + + // Create name attribute + const nameAttributeResponse = http.post( + `${endpoint}/databases/${databaseId}/collections/${collectionId}/attributes/string`, + JSON.stringify({ + key: 'name', + size: 100, + required: false, + default: null, + array: false, + encrypt: false + }), + { headers: apiHeaders } + ); + + assert(nameAttributeResponse, 'name attribute created successfully', (r) => r.status === 202); + + // Create age attribute + const ageAttributeResponse = http.post( + `${endpoint}/databases/${databaseId}/collections/${collectionId}/attributes/integer`, + JSON.stringify({ + key: 'age', + required: false, + }), + { headers: apiHeaders } + ); + + assert(ageAttributeResponse, 'age attribute created successfully', (r) => r.status === 202); + + // Create email attribute + const emailAttributeResponse = http.post( + `${endpoint}/databases/${databaseId}/collections/${collectionId}/attributes/email`, + JSON.stringify({ + key: 'email', + required: false, + }), + { headers: apiHeaders } + ); + + assert(emailAttributeResponse, 'email attribute created successfully', (r) => r.status === 202); + + // Create height attribute + const heightAttributeResponse = http.post( + `${endpoint}/databases/${databaseId}/collections/${collectionId}/attributes/float`, + JSON.stringify({ + key: 'height', + required: false, + }), + { headers: apiHeaders } + ); + + assert(heightAttributeResponse, 'height attribute created successfully', (r) => r.status === 202); + + return { + databaseId, + collectionId + }; +} + +export function cleanup(config) { + const { + endpoint, + teamId, + headers + } = config; + + // Delete Organization + const organizationResponse = http.del( + `${endpoint}/teams/${teamId}`, + null, + { + headers + } + ); + + assert(organizationResponse, 'organization deleted successfully', (r) => r.status === 204); +} + +export function unique() { + const timestamp = Date.now().toString(36); + const randomPart = Math.random().toString(36).substring(2, 15); + return `${timestamp}-${randomPart}`; +} \ No newline at end of file From c560524a42f08471940567505896c41f166fc3a0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 13 Feb 2025 16:52:53 +0900 Subject: [PATCH 096/161] Add more benchmarks, update DB Lib --- composer.json | 6 +- composer.lock | 80 +++++------ .../bulk-operations/LargeDocumentCreation.js | 127 ++++++++++++++++++ 3 files changed, 170 insertions(+), 43 deletions(-) create mode 100644 tests/benchmarks/bulk-operations/LargeDocumentCreation.js diff --git a/composer.json b/composer.json index dc86ab2346..3e696334b0 100644 --- a/composer.json +++ b/composer.json @@ -45,13 +45,13 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.16.*", "appwrite/php-clamav": "2.0.*", - "utopia-php/abuse": "0.49.*", + "utopia-php/abuse": "0.50.*", "utopia-php/analytics": "0.10.*", - "utopia-php/audit": "0.49.*", + "utopia-php/audit": "0.51.*", "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.58.4", + "utopia-php/database": "0.59.0", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index df834c4c02..6365889eea 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "53423a0249dc52d6d27bc26dc9425206", + "content-hash": "b17c58729c4380afcba7714e9bced863", "packages": [ { "name": "adhocore/jwt", @@ -3377,16 +3377,16 @@ }, { "name": "utopia-php/abuse", - "version": "0.49.0", + "version": "0.50.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "76612c274b895aa3d4d1fa27557a6402463eea99" + "reference": "3ff67819e9de61506c5ca070a70552f7ebe99f80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/76612c274b895aa3d4d1fa27557a6402463eea99", - "reference": "76612c274b895aa3d4d1fa27557a6402463eea99", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/3ff67819e9de61506c5ca070a70552f7ebe99f80", + "reference": "3ff67819e9de61506c5ca070a70552f7ebe99f80", "shasum": "" }, "require": { @@ -3394,7 +3394,7 @@ "ext-pdo": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/database": "0.58.*" + "utopia-php/database": "0.59.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3422,9 +3422,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.49.0" + "source": "https://github.com/utopia-php/abuse/tree/0.50.0" }, - "time": "2025-02-04T07:33:59+00:00" + "time": "2025-02-12T09:13:59+00:00" }, { "name": "utopia-php/analytics", @@ -3474,21 +3474,21 @@ }, { "name": "utopia-php/audit", - "version": "0.49.0", + "version": "0.51.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "9d5c5e0cf0f6d9157b911fc3971da4331d71c96d" + "reference": "a5a4b73a57e27a0fac8025b1d6038e145a1ca04e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/9d5c5e0cf0f6d9157b911fc3971da4331d71c96d", - "reference": "9d5c5e0cf0f6d9157b911fc3971da4331d71c96d", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/a5a4b73a57e27a0fac8025b1d6038e145a1ca04e", + "reference": "a5a4b73a57e27a0fac8025b1d6038e145a1ca04e", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/database": "0.58.*" + "utopia-php/database": "0.59.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3515,9 +3515,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.49.0" + "source": "https://github.com/utopia-php/audit/tree/0.51.0" }, - "time": "2025-02-04T07:27:18+00:00" + "time": "2025-02-12T09:12:44+00:00" }, { "name": "utopia-php/cache", @@ -3717,16 +3717,16 @@ }, { "name": "utopia-php/database", - "version": "0.58.4", + "version": "0.59.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ff3fd22e4fe757cc2a78f17169f6dcc45c96d0fe" + "reference": "0eed7f1ad3eb66ff4a7d73b68dd9d3e05089eb18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ff3fd22e4fe757cc2a78f17169f6dcc45c96d0fe", - "reference": "ff3fd22e4fe757cc2a78f17169f6dcc45c96d0fe", + "url": "https://api.github.com/repos/utopia-php/database/zipball/0eed7f1ad3eb66ff4a7d73b68dd9d3e05089eb18", + "reference": "0eed7f1ad3eb66ff4a7d73b68dd9d3e05089eb18", "shasum": "" }, "require": { @@ -3767,9 +3767,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.58.4" + "source": "https://github.com/utopia-php/database/tree/0.59.0" }, - "time": "2025-02-05T02:51:02+00:00" + "time": "2025-02-12T08:08:29+00:00" }, { "name": "utopia-php/domains", @@ -4170,16 +4170,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.17", + "version": "0.6.18", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "677a5c4688d7f54d1631a91f76a35d51346cf96b" + "reference": "013fe03ff17fffd80dbd3564dc1a0cdd4f4a98ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/677a5c4688d7f54d1631a91f76a35d51346cf96b", - "reference": "677a5c4688d7f54d1631a91f76a35d51346cf96b", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/013fe03ff17fffd80dbd3564dc1a0cdd4f4a98ae", + "reference": "013fe03ff17fffd80dbd3564dc1a0cdd4f4a98ae", "shasum": "" }, "require": { @@ -4187,7 +4187,7 @@ "ext-curl": "*", "ext-openssl": "*", "php": ">=8.1", - "utopia-php/database": "0.58.*", + "utopia-php/database": "0.59.*", "utopia-php/dsn": "0.2.*", "utopia-php/framework": "0.33.*", "utopia-php/storage": "0.18.*" @@ -4220,9 +4220,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.17" + "source": "https://github.com/utopia-php/migration/tree/0.6.18" }, - "time": "2025-02-05T05:27:29+00:00" + "time": "2025-02-12T09:09:32+00:00" }, { "name": "utopia-php/mongo", @@ -4607,16 +4607,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.8", + "version": "0.18.9", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "84737afa634e6a833fc4f8b0c967553234d3f215" + "reference": "1cf455404e8700b3093fd73d74a38d41cdced90c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/84737afa634e6a833fc4f8b0c967553234d3f215", - "reference": "84737afa634e6a833fc4f8b0c967553234d3f215", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/1cf455404e8700b3093fd73d74a38d41cdced90c", + "reference": "1cf455404e8700b3093fd73d74a38d41cdced90c", "shasum": "" }, "require": { @@ -4656,9 +4656,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.8" + "source": "https://github.com/utopia-php/storage/tree/0.18.9" }, - "time": "2024-12-04T08:30:35+00:00" + "time": "2025-02-11T13:10:40+00:00" }, { "name": "utopia-php/swoole", @@ -5560,16 +5560,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -5608,7 +5608,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -5616,7 +5616,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", diff --git a/tests/benchmarks/bulk-operations/LargeDocumentCreation.js b/tests/benchmarks/bulk-operations/LargeDocumentCreation.js new file mode 100644 index 0000000000..c903ed2dba --- /dev/null +++ b/tests/benchmarks/bulk-operations/LargeDocumentCreation.js @@ -0,0 +1,127 @@ +import { check, sleep } from "k6"; +import http from "k6/http"; +import { provisionProject, provisionDatabase, cleanup, unique } from "./utils.js"; + +const millionRecords = 1_000_000; +const batchSize = 10_000; +const numBatches = millionRecords / batchSize; + +export function setup() { + const resources = provisionProject({ + endpoint: 'http://localhost/v1', + email: 'test@test.com', + password: 'password123', + name: 'Test User', + projectName: 'Large Document Creation Test' + }); + + const { databaseId, collectionId } = provisionDatabase({ + endpoint: 'http://localhost/v1', + apiHeaders: resources.apiHeaders + }); + + // Wait to ensure that provisioning is complete + sleep(5); + + // Create an index for the collection + const index = { + key: "name", + type: "fulltext", + orders: ["ASC"], + attributes: ["name", "email"] + }; + + const indexRes = http.post(`http://localhost/v1/databases/${databaseId}/collections/${collectionId}/indexes`, + JSON.stringify(index), { + headers: resources.apiHeaders + }); + + console.log(indexRes.status); + + check(indexRes, { + "status is 202": (r) => r.status === 202, + }); + + console.log(`----- Inserting ${millionRecords} documents in ${numBatches} batches of ${batchSize} -----`); + + const timeStart = new Date(); + + const requests = []; + for (let i = 0; i < numBatches; i++) { + const docs = Array.from({ length: batchSize }, () => ({ + $id: unique(), + name: "bulk_document", + age: Math.floor(Math.random() * 100), + email: `${unique()}@test.com`, + height: Math.random() * 100 + })); + requests.push({ + method: "POST", + url: `http://localhost/v1/databases/${databaseId}/collections/${collectionId}/documents`, + body: JSON.stringify({ documents: docs }), + params: { + headers: resources.apiHeaders, + timeout: '300s' + } + }); + } + + const responses = http.batch(requests); + responses.forEach((res, index) => { + if (res.status !== 201) { + throw new Error(`Batch ${index + 1} failed with status ${res.status}`); + } + }); + + const timeEnd = new Date(); + const timeTaken = timeEnd - timeStart; + console.log(`Created 1 million documents in ${timeTaken} milliseconds`); + + return { + databaseId, + collectionId, + apiHeaders: resources.apiHeaders, + resources + }; +} + +export default function (data) { + const docs = Array.from({ length: 10000 }, () => ({ + $id: unique(), + name: "performance_document", + age: Math.floor(Math.random() * 100), + email: `${unique()}@test.com`, + height: Math.random() * 100 + })); + + const payload = JSON.stringify({ documents: docs }); + const res = http.post( + `http://localhost/v1/databases/${data.databaseId}/collections/${data.collectionId}/documents`, + payload, + { + headers: data.apiHeaders, + timeout: '300s' + } + ); + + check(res, { + "status is 201": (r) => r.status === 201 + }); + + sleep(1); +} + +export function teardown(data) { + cleanup(data.resources); +} + +export const options = { + scenarios: { + large_document_creation: { + executor: 'per-vu-iterations', + vus: 1, + iterations: 20, + exec: 'default' + } + } +}; \ No newline at end of file From 99377e26ee077d263bd683c3fcc6de07b150fb30 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 5 Mar 2025 15:09:06 +1300 Subject: [PATCH 097/161] Reset fixes --- .env | 1 - app/controllers/api/databases.php | 81 +++++++++++-------- app/init.php | 1 + composer.json | 6 +- .../e2e/Services/Databases/DatabasesBase.php | 1 - 5 files changed, 55 insertions(+), 35 deletions(-) diff --git a/.env b/.env index 26067755e4..1893e023ba 100644 --- a/.env +++ b/.env @@ -34,7 +34,6 @@ _APP_DB_SCHEMA=appwrite _APP_DB_USER=user _APP_DB_PASS=password _APP_DB_ROOT_PASS=rootsecretpassword -_APP_DATABASE_BATCH_SIZE=10_000 _APP_STORAGE_DEVICE=Local _APP_STORAGE_S3_ACCESS_KEY= _APP_STORAGE_S3_SECRET= diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index c96b614453..f76322924f 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -52,7 +52,6 @@ use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\Structure; use Utopia\Database\Validator\UID; use Utopia\Locale\Locale; -use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\FloatValidator; @@ -3176,23 +3175,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForStatsUsage') ->inject('project') ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Document $project) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + $data = \is_string($data) + ? \json_decode($data, true) + : $data; + $isBulk = true; if (empty($data) && empty($documents)) { throw new Exception(Exception::DOCUMENT_MISSING_DATA); } - if (!empty($data) && !empty($documents)) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, 'You can only send one of the following parameters: data, documents'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'You can only send one of the following parameters: data, documents'); } - if (!empty($data) && empty($documentId)) { throw new Exception(Exception::DOCUMENT_MISSING_DATA, 'Document ID is required when creating a single document'); } - if (!empty($documents) && !empty($documentId)) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, set $id in each document'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, set "$id" in each document instead'); + } + if (!empty($documents) && !empty($permissions)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "permissions" is disallowed when creating multiple documents, set "$permissions" in each document instead'); } if (!empty($data)) { @@ -3200,7 +3202,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = [$data]; } - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = Authorization::skip(fn () => $dbForProject->getDocument( + 'databases', + $databaseId + )); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -3222,7 +3227,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ]; $setPermissions = function (Document $document, ?array $permissions) use ($user, $allowedPermissions, $isAPIKey, $isPrivilegedUser, $isBulk) { - // Map aggregate permissions to into the set of individual permissions they represent. if ($isBulk) { $permissions = $document['$permissions'] ?? null; } @@ -3368,12 +3372,16 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') }, $documents); try { - $dbForProject->createDocuments('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documents); + $dbForProject->createDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $documents, + APP_LIMIT_DATABASE_BATCH + ); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); - } catch (DuplicateException $e) { + } catch (DuplicateException) { throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (NotFoundException $e) { + } catch (NotFoundException) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -3426,27 +3434,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations) ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection - $response->addHeader('X-Debug-Operations', $operations); + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->addHeader('X-Debug-Operations', $operations); if ($isBulk) { - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic(new Document([ - 'total' => count($documents), - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); + $response->dynamic(new Document([ + 'total' => count($documents), + 'documents' => $documents + ]), Response::MODEL_DOCUMENT_LIST); } else { $queueForEvents ->setParam('documentId', $document->getId()) ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($documents[0], Response::MODEL_DOCUMENT); + $response->dynamic( + $documents[0], + Response::MODEL_DOCUMENT + ); } - $queueForStatsUsage - ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents') @@ -4157,7 +4164,11 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $queries = Query::parseQueries($queries); + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } // Map aggregate permissions into the multiple permissions they represent. $permissions = Permission::aggregate($permissions, [ @@ -4190,6 +4201,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') if (!\is_null($permissions)) { $data['$permissions'] = $permissions; } + $partialDocument = new Document($data); $documents = $dbForProject->withRequestTimestamp( @@ -4197,7 +4209,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') fn () => $dbForProject->updateDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, - $queries + $queries, + APP_LIMIT_DATABASE_BATCH ) ); @@ -4368,7 +4381,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->setContext('database', $database) ->setPayload($response->output($document, Response::MODEL_DOCUMENT), sensitive: $relationships); - $queueForUsage + $queueForStatsUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection $response->noContent(); @@ -4403,9 +4416,9 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->inject('queueForUsage') + ->inject('queueForStatsUsage') ->inject('project') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Usage $queueForUsage, Document $project) { + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Document $project) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -4421,18 +4434,22 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $queries = Query::parseQueries($queries); + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } $documents = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { return $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, - intval(System::getEnv('_APP_DATABASE_BATCH_SIZE', 10_000)) + APP_LIMIT_DATABASE_BATCH ); }); // DB Storage Calculation - $queueForUsage + $queueForStatsUsage ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database): bool { diff --git a/app/init.php b/app/init.php index ebe1e0728a..744e4d4059 100644 --- a/app/init.php +++ b/app/init.php @@ -120,6 +120,7 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls +const APP_LIMIT_DATABASE_BATCH = 1000; // Default maximum number of accept and return in batch API calls const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours diff --git a/composer.json b/composer.json index 964e209140..823e7cc4a2 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } }, "require": { - "php": ">=8.0.0", + "php": ">=8.3.0", "ext-curl": "*", "ext-imagick": "*", "ext-mbstring": "*", @@ -97,6 +97,10 @@ "config": { "platform": { "php": "8.3" + }, + "allow-plugins": { + "php-http/discovery": true, + "tbachert/spi": true } } } diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index f1849a6f50..a7c4c13c31 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4999,7 +4999,6 @@ trait DatabasesBase ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('$id is required inside documents when creating bulk documents', $response['body']['message']); // TEST FAIL - Can't miss number in bulk documents $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ From 0f0ea5e96c72efd46236c9b9aa7c6df9d9246e2b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 5 Mar 2025 15:18:14 +1300 Subject: [PATCH 098/161] Update deps --- composer.json | 4 ++-- composer.lock | 50 ++++++++++++++++++++++++++------------------------ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index 823e7cc4a2..be7f2e3a47 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "utopia-php/abuse": "0.51.*", "utopia-php/analytics": "0.10.*", "utopia-php/audit": "0.54.*", - "utopia-php/cache": "0.11.*", + "utopia-php/cache": "0.12.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", "utopia-php/database": "0.60.*", @@ -71,7 +71,7 @@ "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.9.*", "utopia-php/telemetry": "0.1.*", - "utopia-php/vcs": "0.8.*", + "utopia-php/vcs": "0.9.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index 50eca60bb2..ada1f629ab 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cfc5d9267ecdd5f5159addd4ebfffd2d", + "content-hash": "fc0403c64758248a8147745b6fd7a214", "packages": [ { "name": "adhocore/jwt", @@ -3508,23 +3508,24 @@ }, { "name": "utopia-php/cache", - "version": "0.11.0", + "version": "0.12.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc" + "reference": "646038f1d470b759c129348be8fc14da3c00bbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/8ebcab5aac7606331cef69b0081f6c9eff2e58bc", - "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/646038f1d470b759c129348be8fc14da3c00bbd9", + "reference": "646038f1d470b759c129348be8fc14da3c00bbd9", "shasum": "" }, "require": { "ext-json": "*", "ext-memcached": "*", "ext-redis": "*", - "php": ">=8.0" + "php": ">=8.0", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -3552,9 +3553,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.11.0" + "source": "https://github.com/utopia-php/cache/tree/0.12.0" }, - "time": "2024-11-05T16:53:58+00:00" + "time": "2025-02-25T09:09:21+00:00" }, { "name": "utopia-php/cli", @@ -3704,23 +3705,23 @@ }, { "name": "utopia-php/database", - "version": "0.60.3", + "version": "0.60.6", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "c4bc4af3f09a91aea76aac75b4b78fa06598c61d" + "reference": "f3c9aa964b39c6205069f038a26e709a15541406" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/c4bc4af3f09a91aea76aac75b4b78fa06598c61d", - "reference": "c4bc4af3f09a91aea76aac75b4b78fa06598c61d", + "url": "https://api.github.com/repos/utopia-php/database/zipball/f3c9aa964b39c6205069f038a26e709a15541406", + "reference": "f3c9aa964b39c6205069f038a26e709a15541406", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-pdo": "*", "php": ">=8.1", - "utopia-php/cache": "0.11.*", + "utopia-php/cache": "0.12.*", "utopia-php/framework": "0.33.*", "utopia-php/mongo": "0.3.*" }, @@ -3754,9 +3755,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.60.3" + "source": "https://github.com/utopia-php/database/tree/0.60.6" }, - "time": "2025-02-17T12:46:59+00:00" + "time": "2025-03-05T01:23:14+00:00" }, { "name": "utopia-php/domains", @@ -4807,23 +4808,24 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.6", + "version": "0.9.3", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "b10225f54d5670f09f83e82e09de9d820ada6931" + "reference": "865a00c67e81a20938b883f9aa802303790dd3b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b10225f54d5670f09f83e82e09de9d820ada6931", - "reference": "b10225f54d5670f09f83e82e09de9d820ada6931", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/865a00c67e81a20938b883f9aa802303790dd3b5", + "reference": "865a00c67e81a20938b883f9aa802303790dd3b5", "shasum": "" }, "require": { "adhocore/jwt": "^1.1", "php": ">=8.0", - "utopia-php/cache": "^0.11.0", - "utopia-php/framework": "0.*.*" + "utopia-php/cache": "0.12.*", + "utopia-php/framework": "0.*.*", + "utopia-php/system": "0.9.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -4850,9 +4852,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.6" + "source": "https://github.com/utopia-php/vcs/tree/0.9.3" }, - "time": "2024-12-10T13:13:23+00:00" + "time": "2025-02-26T16:33:35+00:00" }, { "name": "utopia-php/websocket", @@ -8402,7 +8404,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0.0", + "php": ">=8.3.0", "ext-curl": "*", "ext-imagick": "*", "ext-mbstring": "*", From 2f43a3566dee06ca982bcf1bf4f822ef2179c06c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 5 Mar 2025 16:42:09 +1300 Subject: [PATCH 099/161] Remove bulk update permissions param --- app/config/specs/open-api3-1.6.x-client.json | 10 +--------- app/config/specs/open-api3-1.6.x-console.json | 10 +--------- app/config/specs/open-api3-1.6.x-server.json | 10 +--------- app/config/specs/open-api3-latest-client.json | 10 +--------- app/config/specs/open-api3-latest-console.json | 10 +--------- app/config/specs/open-api3-latest-server.json | 10 +--------- app/config/specs/swagger2-1.6.x-client.json | 11 +---------- app/config/specs/swagger2-1.6.x-console.json | 11 +---------- app/config/specs/swagger2-1.6.x-server.json | 11 +---------- app/config/specs/swagger2-latest-client.json | 11 +---------- app/config/specs/swagger2-latest-console.json | 11 +---------- app/config/specs/swagger2-latest-server.json | 11 +---------- app/controllers/api/databases.php | 15 +++++++++------ 13 files changed, 21 insertions(+), 120 deletions(-) diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index d5351f7f58..0b92434498 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -4520,7 +4520,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -4595,14 +4595,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 3feb176ab7..845ebef2ef 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -7978,7 +7978,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8053,14 +8053,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index 22dcd0dd14..120be407a2 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -7538,7 +7538,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7615,14 +7615,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index d5351f7f58..0b92434498 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4520,7 +4520,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -4595,14 +4595,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 3feb176ab7..845ebef2ef 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -7978,7 +7978,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8053,14 +8053,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 22dcd0dd14..120be407a2 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7538,7 +7538,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7615,14 +7615,6 @@ "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index d8a3baa218..2f9375f3b9 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -4702,7 +4702,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -4769,15 +4769,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index a05af4546c..fef7ff4ea5 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -8167,7 +8167,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8234,15 +8234,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index a76c25257d..3aaf42f08c 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -7709,7 +7709,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7778,15 +7778,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index d8a3baa218..2f9375f3b9 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4702,7 +4702,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -4769,15 +4769,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index a05af4546c..fef7ff4ea5 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8167,7 +8167,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8234,15 +8234,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index a76c25257d..3aaf42f08c 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7709,7 +7709,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, If none are submitted then all documents are updated. Using the patch method you can pass only specific fields that will get updated.", + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7778,15 +7778,6 @@ "default": [], "x-example": "{}" }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - }, "queries": { "type": "array", "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f76322924f..4617e6135e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4136,24 +4136,25 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') ->inject('project') - ->action(function (string $databaseId, string $collectionId, string|array $data, ?array $permissions, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Document $project) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array + ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Document $project) { + $data = \is_string($data) + ? \json_decode($data, true) + : $data; - if (empty($data) && \is_null($permissions)) { + if (empty($data)) { throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); } - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND); } @@ -4170,6 +4171,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } + $permissions = $data['$permissions'] ?? null; + // Map aggregate permissions into the multiple permissions they represent. $permissions = Permission::aggregate($permissions, [ Database::PERMISSION_READ, From bc866dc7173b7508ce455f4d43a360b848393020 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 17 Mar 2025 21:10:30 +1300 Subject: [PATCH 100/161] Sync with 1.6.x --- app/controllers/api/databases.php | 2 +- app/init/constants.php | 2 ++ composer.lock | 50 +++++++++++++++---------------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b154c6f67d..1548778ceb 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3169,7 +3169,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'Array of documents data as JSON object.', true) + ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_DOCUMENTS_CREATE), 'Array of documents data as JSON object.', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') diff --git a/app/init/constants.php b/app/init/constants.php index 3383b28f57..1090b2068a 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -26,6 +26,8 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls +const APP_LIMIT_DOCUMENTS_CREATE = 5_000; // Default maximum of how many documents can be inserted in a single request +const APP_LIMIT_DATABASE_BATCH = 1_000; // Default batch size for database operations const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours diff --git a/composer.lock b/composer.lock index 9d5725c5ea..0ba2cf38c9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fc0403c64758248a8147745b6fd7a214", + "content-hash": "54fc27a2c8d4f5ab4959dbc93be319e1", "packages": [ { "name": "adhocore/jwt", @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.30.0", + "version": "v4.30.1", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "e1d66682f6836aa87820400f0aa07d9eb566feb6" + "reference": "f29ba8a30dfd940efb3a8a75dc44446539101f24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/e1d66682f6836aa87820400f0aa07d9eb566feb6", - "reference": "e1d66682f6836aa87820400f0aa07d9eb566feb6", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/f29ba8a30dfd940efb3a8a75dc44446539101f24", + "reference": "f29ba8a30dfd940efb3a8a75dc44446539101f24", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.30.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.30.1" }, - "time": "2025-03-04T22:54:49+00:00" + "time": "2025-03-13T21:08:17+00:00" }, { "name": "jean85/pretty-package-versions", @@ -3705,16 +3705,16 @@ }, { "name": "utopia-php/database", - "version": "0.60.6", + "version": "0.61.2", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "f3c9aa964b39c6205069f038a26e709a15541406" + "reference": "349fbdf4bc088f7775c7dfb8b80239a617a88436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/f3c9aa964b39c6205069f038a26e709a15541406", - "reference": "f3c9aa964b39c6205069f038a26e709a15541406", + "url": "https://api.github.com/repos/utopia-php/database/zipball/349fbdf4bc088f7775c7dfb8b80239a617a88436", + "reference": "349fbdf4bc088f7775c7dfb8b80239a617a88436", "shasum": "" }, "require": { @@ -3755,9 +3755,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.60.6" + "source": "https://github.com/utopia-php/database/tree/0.61.2" }, - "time": "2025-03-05T01:23:14+00:00" + "time": "2025-03-15T11:47:42+00:00" }, { "name": "utopia-php/domains", @@ -4810,16 +4810,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.9.3", + "version": "0.9.4", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "865a00c67e81a20938b883f9aa802303790dd3b5" + "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/865a00c67e81a20938b883f9aa802303790dd3b5", - "reference": "865a00c67e81a20938b883f9aa802303790dd3b5", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/1a8d280b176acc99ea8d9e7364b8767cbb206b4a", + "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a", "shasum": "" }, "require": { @@ -4854,9 +4854,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.9.3" + "source": "https://github.com/utopia-php/vcs/tree/0.9.4" }, - "time": "2025-02-26T16:33:35+00:00" + "time": "2025-03-13T10:09:45+00:00" }, { "name": "utopia-php/websocket", @@ -5043,16 +5043,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.40.1", + "version": "0.40.7", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "df180676b6fbde7832ae1495af3e2f3e8f700837" + "reference": "9e89b0bc4d8e6c81817d27096629f34a149fa873" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/df180676b6fbde7832ae1495af3e2f3e8f700837", - "reference": "df180676b6fbde7832ae1495af3e2f3e8f700837", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9e89b0bc4d8e6c81817d27096629f34a149fa873", + "reference": "9e89b0bc4d8e6c81817d27096629f34a149fa873", "shasum": "" }, "require": { @@ -5088,9 +5088,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.40.1" + "source": "https://github.com/appwrite/sdk-generator/tree/0.40.7" }, - "time": "2025-02-26T07:07:10+00:00" + "time": "2025-03-12T08:43:55+00:00" }, { "name": "doctrine/annotations", From 7e6799d6dd50f5f97d68ce3e8b7415265d0a8263 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 18:13:10 +1300 Subject: [PATCH 101/161] Block bulk operations on collections with relationships --- app/controllers/api/databases.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 61f8249508..fcd602a316 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3223,6 +3223,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($isBulk && $hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); + } + $allowedPermissions = [ Database::PERMISSION_READ, Database::PERMISSION_UPDATE, @@ -4168,6 +4177,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); + } + try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -4440,6 +4458,15 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::COLLECTION_NOT_FOUND); } + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); + } + try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { From 985476ac502c8eb707943214a24ff2f97a53c677 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 18:16:25 +1300 Subject: [PATCH 102/161] Bulk operations for server/console only --- app/controllers/api/databases.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index fcd602a316..6bfa84b909 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3149,7 +3149,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') namespace: 'databases', name: 'createDocuments', description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + auth: [AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, @@ -4136,7 +4136,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') namespace: 'databases', name: 'updateDocuments', description: '/docs/references/databases/update-documents.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + auth: [AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, @@ -4425,7 +4425,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') namespace: 'databases', name: 'deleteDocuments', description: '/docs/references/databases/delete-documents.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + auth: [AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, From ee9efe530dca87c64b93539a7fcad8ebe3113024 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 18:28:55 +1300 Subject: [PATCH 103/161] Add max batch size resource for plan override --- app/controllers/api/databases.php | 24 ++++++++++++++---------- app/init/resources.php | 4 ++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6bfa84b909..3186e0dc58 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3176,8 +3176,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForStatsUsage') - ->inject('project') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Document $project) { + ->inject('maxBatchSize') + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, int $maxBatchSize) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -3231,6 +3231,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') if ($isBulk && $hasRelationships) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); } + + if ($isBulk && \count($documents) > $maxBatchSize) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is limited to ' . $maxBatchSize . ' documents'); + } $allowedPermissions = [ Database::PERMISSION_READ, @@ -3387,7 +3391,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $dbForProject->createDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documents, - APP_LIMIT_DATABASE_BATCH + $maxBatchSize ); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); @@ -4152,8 +4156,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->inject('project') - ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Document $project) { + ->inject('maxBatchSize') + ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, int $maxBatchSize) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -4234,7 +4238,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, $queries, - APP_LIMIT_DATABASE_BATCH + $maxBatchSize ) ); @@ -4441,8 +4445,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') - ->inject('project') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, Document $project) { + ->inject('maxBatchSize') + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, int $maxBatchSize) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -4473,11 +4477,11 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $documents = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries) { + $documents = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries, $maxBatchSize) { return $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, - APP_LIMIT_DATABASE_BATCH + $maxBatchSize ); }); diff --git a/app/init/resources.php b/app/init/resources.php index 4e53b24c06..068cdd656a 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -822,3 +822,7 @@ App::setResource('apiKey', function (Request $request, Document $project): ?Key return Key::decode($project, $key); }, ['request', 'project']); + +App::setResource('maxBatchSize', function () { + return APP_LIMIT_DATABASE_BATCH; +}); From 7ca4009457d60e3cef7077addbdd9f827db7c5dd Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:01:59 +1300 Subject: [PATCH 104/161] Remove leftover --- app/config/services.php | 3 --- src/Appwrite/Platform/Tasks/Specs.php | 1 - 2 files changed, 4 deletions(-) diff --git a/app/config/services.php b/app/config/services.php index c4fb98c59a..3ac1601b7c 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -65,9 +65,6 @@ return [ 'tests' => false, 'optional' => true, 'icon' => '/images/services/databases.png', - 'globalAttributes' => [ - 'databaseId' - ] ], 'locale' => [ 'key' => 'locale', diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 4d7fd5d695..5b10c1ef25 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -262,7 +262,6 @@ class Specs extends Action $services[] = [ 'name' => $service['key'] ?? '', 'description' => $service['subtitle'] ?? '', - 'x-globalAttributes' => $service['globalAttributes'] ?? [], ]; } From 6615c1a38241d17af1a9937a55df77881cf1abc5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:02:25 +1300 Subject: [PATCH 105/161] Add SDK parameter class --- src/Appwrite/SDK/Parameter.php | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/Appwrite/SDK/Parameter.php diff --git a/src/Appwrite/SDK/Parameter.php b/src/Appwrite/SDK/Parameter.php new file mode 100644 index 0000000000..2a0e463733 --- /dev/null +++ b/src/Appwrite/SDK/Parameter.php @@ -0,0 +1,75 @@ +name; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function getDescription(): string + { + return $this->description; + } + + public function setDescription(string $description): void + { + $this->description = $description; + } + + public function getDefault(): mixed + { + return $this->default; + } + + public function setDefault(mixed $default): void + { + $this->default = $default; + } + + public function getValidator(): mixed + { + return $this->validator; + } + + public function setValidator(mixed $validator): void + { + $this->validator = $validator; + } + + public function isOptional(): bool + { + return $this->optional; + } + + public function setOptional(bool $optional): void + { + $this->optional = $optional; + } +} \ No newline at end of file From 254c12b084a950898fc0e5a83daffc0ff3ea75ac Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:03:10 +1300 Subject: [PATCH 106/161] Use parameter class in method class --- src/Appwrite/SDK/Method.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 626459ea7f..b2b2632012 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -20,16 +20,14 @@ class Method * @param string $description * @param array $auth * @param array $responses - * @param ContentType $responseType - * @param MethodType|null $methodType + * @param ContentType $contentType + * @param MethodType|null $type * @param bool $deprecated * @param array|bool $hide * @param bool $packaging - * @param string $requestType - * @param array $parameters + * @param ContentType $requestType + * @param array $parameters * @param array $additionalParameters - * - * @throws \Exception */ public function __construct( protected string $namespace, @@ -42,16 +40,16 @@ class Method protected bool $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, - protected string $requestType = 'application/json', + protected ContentType $requestType = ContentType::JSON, protected array $parameters = [], protected array $additionalParameters = [] - ) { + ) + { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); $this->validateDesc($description); foreach ($responses as $response) { - /** @var SDKResponse $response */ $this->validateResponseModel($response->getModel()); $this->validateNoContent($response); } @@ -189,6 +187,9 @@ class Method return $this->requestType; } + /** + * @return array + */ public function getParameters(): array { return $this->parameters; From 5aca1fcfa931288fdd8f24b5342443ef06418a06 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:03:28 +1300 Subject: [PATCH 107/161] Fix content type usage --- app/controllers/api/functions.php | 3 +-- app/controllers/api/storage.php | 6 +++--- app/controllers/general.php | 1 - app/controllers/shared/api.php | 2 ++ src/Appwrite/SDK/Method.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 37932e4165..a58f76bae0 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1263,7 +1263,7 @@ App::post('/v1/functions/:functionId/deployments') ], type: MethodType::UPLOAD, packaging: true, - requestType: 'multipart/form-data', + requestType: ContentType::MULTIPART, )) ->param('functionId', '', new UID(), 'Function ID.') ->param('entrypoint', null, new Text(1028), 'Entrypoint File.', true) @@ -1868,7 +1868,6 @@ App::post('/v1/functions/:functionId/executions') ) ], contentType: ContentType::MULTIPART, - requestType: 'application/json', )) ->param('functionId', '', new UID(), 'Function ID.') ->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index f13c9703c5..f3711fc46a 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -389,15 +389,15 @@ App::post('/v1/storage/buckets/:bucketId/files') namespace: 'storage', name: 'createFile', description: '/docs/references/storage/create-file.md', - type: MethodType::UPLOAD, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - requestType: 'multipart/form-data', responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, model: Response::MODEL_FILE, ) - ] + ], + type: MethodType::UPLOAD, + requestType: ContentType::MULTIPART )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') diff --git a/app/controllers/general.php b/app/controllers/general.php index a374aa3c39..1270e880d7 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -135,7 +135,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ) ], contentType: ContentType::MULTIPART, - requestType: 'application/json', )); } else { /** @var Method $method */ diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9c4885a4e0..2b01f583dd 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -333,6 +333,8 @@ App::init() */ $method = $route->getLabel('sdk', false); + // Take the first method if there's more than one, + // namespace can not differ between methods on the same route if (\is_array($method)) { $method = $method[0]; } diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index b2b2632012..e1c2508f74 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -182,7 +182,7 @@ class Method return $this->packaging; } - public function getRequestType(): string + public function getRequestType(): ContentType { return $this->requestType; } @@ -268,7 +268,7 @@ class Method return $this; } - public function setRequestType(string $requestType): self + public function setRequestType(ContentType $requestType): self { $this->requestType = $requestType; return $this; From 04c3182f7c52b5f02829189088e667d388cf6c3e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:03:56 +1300 Subject: [PATCH 108/161] Use parameter class instead of inline array --- app/controllers/api/databases.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 3186e0dc58..aa25bd37b1 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -10,6 +10,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; +use Appwrite\SDK\Parameter; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -3138,11 +3139,11 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ - 'databaseId' => ['optional' => false], - 'collectionId' => ['optional' => false], - 'documentId' => ['optional' => false], - 'data' => ['optional' => false], - 'permissions' => ['optional' => true], + new Parameter('databaseId', optional: false), + new Parameter('collectionId', optional: false), + new Parameter('documentId', optional: false), + new Parameter('data', optional: false), + new Parameter('permissions', optional: true), ] ), new Method( @@ -3231,7 +3232,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') if ($isBulk && $hasRelationships) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); } - + if ($isBulk && \count($documents) > $maxBatchSize) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is limited to ' . $maxBatchSize . ' documents'); } From aa0111550b1ae583c95a6a24a61bd764da1f58c2 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:04:14 +1300 Subject: [PATCH 109/161] Handle parameter class for spec generation --- src/Appwrite/Platform/Tasks/Specs.php | 18 ++++-- src/Appwrite/Specification/Format.php | 4 +- .../Specification/Format/Swagger2.php | 61 ++++++++----------- 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 5b10c1ef25..1e9f956606 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Tasks; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; use Appwrite\Specification\Format\OpenAPI3; use Appwrite\Specification\Format\Swagger2; use Appwrite\Specification\Specification; @@ -49,11 +50,10 @@ class Specs extends Action ->desc('Generate Appwrite API specifications') ->param('version', 'latest', new Text(16), 'Spec version', true) ->param('mode', 'normal', new WhiteList(['normal', 'mocks']), 'Spec Mode', true) - ->inject('register') - ->callback(fn (string $version, string $mode, Registry $register) => $this->action($version, $mode, $register)); + ->callback([$this, 'action']); } - public function action(string $version, string $mode, Registry $register): void + public function action(string $version, string $mode): void { $appRoutes = App::getRoutes(); $response = $this->getResponse(); @@ -194,7 +194,7 @@ class Specs extends Action } foreach ($sdks as $sdk) { - /** @var \Appwrite\SDK\Method $sdks */ + /** @var Method $sdk */ $hide = $sdk->isHidden(); if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { @@ -273,7 +273,15 @@ class Specs extends Action } } - $arguments = [new App('UTC'), $services, $routes, $models, $keys[$platform], $authCounts[$platform] ?? 0]; + $arguments = [ + new App('UTC'), + $services, + $routes, + $models, + $keys[$platform], + $authCounts[$platform] ?? 0 + ]; + foreach (['swagger2', 'open-api3'] as $format) { $formatInstance = match ($format) { 'swagger2' => new Swagger2(...$arguments), diff --git a/src/Appwrite/Specification/Format.php b/src/Appwrite/Specification/Format.php index 8396f5cb7c..e9377382d2 100644 --- a/src/Appwrite/Specification/Format.php +++ b/src/Appwrite/Specification/Format.php @@ -12,12 +12,12 @@ abstract class Format protected App $app; /** - * @var Route[] + * @var array */ protected array $routes; /** - * @var Model[] + * @var array */ protected array $models; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 73b7cec923..dfede91ccd 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -3,16 +3,20 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Route; use Utopia\Validator; use Utopia\Validator\ArrayList; use Utopia\Validator\Nullable; use Utopia\Validator\Range; +use Utopia\Validator\WhiteList; class Swagger2 extends Format { @@ -27,28 +31,13 @@ class Swagger2 extends Format if (!in_array($model->getType(), $usedModels)) { continue; } - - if (\is_array($rule['type'])) { - foreach ($rule['type'] as $ruleType) { - if (!in_array($ruleType, ['string', 'integer', 'boolean', 'json', 'float'])) { - $usedModels[] = $ruleType; - - foreach ($this->models as $m) { - if ($m->getType() === $ruleType) { - $this->getNestedModels($m, $usedModels); - continue; - } - } - } - } - } else { - if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float'])) { - $usedModels[] = $rule['type']; - + $types = (array)$rule['type']; + foreach ($types as $ruleType) { + if (!in_array($ruleType, ['string', 'integer', 'boolean', 'json', 'float'])) { + $usedModels[] = $ruleType; foreach ($this->models as $m) { - if ($m->getType() === $rule['type']) { + if ($m->getType() === $ruleType) { $this->getNestedModels($m, $usedModels); - continue; } } } @@ -117,11 +106,12 @@ class Swagger2 extends Format $usedModels = []; foreach ($this->routes as $route) { - /** @var \Utopia\Route $route */ + /** @var Route $route */ $url = \str_replace('/v1', '', $route->getPath()); + $scope = $route->getLabel('scope', ''); - /** @var \Appwrite\SDK\Method $sdk */ + /** @var Method $sdk */ $sdk = $route->getLabel('sdk', false); if (empty($sdk)) { @@ -129,7 +119,7 @@ class Swagger2 extends Format } $additionalMethods = null; - if (is_array($sdk)) { + if (\is_array($sdk)) { $additionalMethods = $sdk; $sdk = $sdk[0]; } @@ -152,10 +142,8 @@ class Swagger2 extends Format case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case AuthType::KEY: - $sdkPlatforms[] = APP_PLATFORM_SERVER; - break; case AuthType::JWT: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; case AuthType::ADMIN: @@ -203,7 +191,7 @@ class Swagger2 extends Format if (!empty($additionalMethods)) { $temp['x-appwrite']['methods'] = []; foreach ($additionalMethods as $method) { - /** @var \Appwrite\SDK\Method $method */ + /** @var Method $method */ $desc = $method->getDescriptionFilePath(); $additionalMethod = [ @@ -214,16 +202,16 @@ class Swagger2 extends Format 'description' => ($desc) ? \file_get_contents($desc) : '', ]; - foreach ($method->getParameters() as $name => $param) { - $additionalMethod['parameters'][] = $name; + foreach ($method->getParameters() as $parameter) { + $additionalMethod['parameters'][] = $parameter->getName(); - if (!$param['optional']) { - $additionalMethod['required'][] = $name; + if (!$parameter->isOptional()) { + $additionalMethod['required'][] = $parameter->getName(); } } foreach ($method->getResponses() as $response) { - /** @var \Appwrite\SDK\Response $response */ + /** @var Response $response */ if (\is_array($response->getModel())) { $additionalMethod['responses'][] = [ 'code' => $response->getCode(), @@ -242,9 +230,8 @@ class Swagger2 extends Format } // Handle Responses - foreach ($sdk->getResponses() as $response) { - /** @var \Appwrite\SDK\Response $response */ + /** @var Response $response */ $model = $response->getModel(); foreach ($this->models as $value) { @@ -339,7 +326,9 @@ class Swagger2 extends Format foreach ($parameters as $name => $param) { // Set params /** @var Validator $validator */ - $validator = (\is_callable($param['validator'])) ? call_user_func_array($param['validator'], $this->app->getResources($param['injections'])) : $param['validator']; + $validator = (\is_callable($param['validator'])) + ? ($param['validator'])($this->app->getResources($param['injections'])) + : $param['validator']; $node = [ 'name' => $name, @@ -484,7 +473,7 @@ class Swagger2 extends Format $node['type'] = $validator->getType(); break; case 'Utopia\Validator\WhiteList': - /** @var \Utopia\Validator\WhiteList $validator */ + /** @var WhiteList $validator */ $node['type'] = $validator->getType(); $node['x-example'] = $validator->getList()[0]; From 7c3d2c8435c98f542aac3970b79e639470215319 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:06:04 +1300 Subject: [PATCH 110/161] Spread validator args --- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index dfede91ccd..bc8d80c2cd 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -327,7 +327,7 @@ class Swagger2 extends Format foreach ($parameters as $name => $param) { // Set params /** @var Validator $validator */ $validator = (\is_callable($param['validator'])) - ? ($param['validator'])($this->app->getResources($param['injections'])) + ? ($param['validator'])(...$this->app->getResources($param['injections'])) : $param['validator']; $node = [ From 6608023b9f8387feee42413506778381909a062f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 21:30:10 +1300 Subject: [PATCH 111/161] Regen specs --- app/config/specs/open-api3-1.6.x-client.json | 237 ++---------------- app/config/specs/open-api3-1.6.x-console.json | 87 +++---- app/config/specs/open-api3-1.6.x-server.json | 72 ++---- app/config/specs/open-api3-latest-client.json | 237 ++---------------- .../specs/open-api3-latest-console.json | 65 ++--- app/config/specs/open-api3-latest-server.json | 68 ++--- app/config/specs/swagger2-1.6.x-client.json | 232 ++--------------- app/config/specs/swagger2-1.6.x-console.json | 88 +++---- app/config/specs/swagger2-1.6.x-server.json | 72 ++---- app/config/specs/swagger2-latest-client.json | 232 ++--------------- app/config/specs/swagger2-latest-console.json | 65 ++--- app/config/specs/swagger2-latest-server.json | 68 ++--- app/controllers/api/databases.php | 6 +- src/Appwrite/Specification/Format.php | 20 ++ .../Specification/Format/OpenAPI3.php | 69 ++--- .../Specification/Format/Swagger2.php | 22 +- 16 files changed, 294 insertions(+), 1346 deletions(-) diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index 0b92434498..4135af6c54 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -4513,191 +4513,6 @@ } } } - }, - "patch": { - "summary": "Update documents", - "operationId": "databasesUpdateDocuments", - "tags": [ - "databases" - ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", - "responses": { - "200": { - "description": "Documents List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/documentList" - } - } - } - } - }, - "x-appwrite": { - "method": "updateDocuments", - "weight": 113, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/update-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", - "x-example": "{}" - }, - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete documents", - "operationId": "databasesDeleteDocuments", - "tags": [ - "databases" - ], - "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", - "responses": { - "200": { - "description": "Documents List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/documentList" - } - } - } - } - }, - "x-appwrite": { - "method": "deleteDocuments", - "weight": 115, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/delete-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", - "rate-limit": 60, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - } - } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7698,85 +7513,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 845ebef2ef..3d156620d2 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -6409,8 +6409,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -6646,8 +6644,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -8004,8 +8000,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8016,8 +8010,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -8099,8 +8092,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8111,8 +8102,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -19294,8 +19284,7 @@ "description": "Project Region.", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -30662,85 +30651,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { @@ -36864,13 +36835,15 @@ }, "x-example": [] }, - "imageTransformationsTotal": { - "type": "integer", - "description": "An array of aggregated number of image transformations.", - "x-example": 0, - "format": "int32" - }, "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { "type": "integer", "description": "Total aggregated number of image transformations.", "x-example": 0, @@ -36907,8 +36880,8 @@ "authPhoneCountryBreakdown", "databasesReads", "databasesWrites", - "imageTransformationsTotal", - "imageTransformations" + "imageTransformations", + "imageTransformationsTotal" ] }, "headers": { diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index 120be407a2..8a9cbd3bb7 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -5953,8 +5953,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -6192,8 +6190,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -7564,22 +7560,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -7661,22 +7653,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -22143,85 +22131,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 0b92434498..4135af6c54 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -4513,191 +4513,6 @@ } } } - }, - "patch": { - "summary": "Update documents", - "operationId": "databasesUpdateDocuments", - "tags": [ - "databases" - ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", - "responses": { - "200": { - "description": "Documents List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/documentList" - } - } - } - } - }, - "x-appwrite": { - "method": "updateDocuments", - "weight": 113, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/update-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", - "x-example": "{}" - }, - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete documents", - "operationId": "databasesDeleteDocuments", - "tags": [ - "databases" - ], - "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", - "responses": { - "200": { - "description": "Documents List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/documentList" - } - } - } - } - }, - "x-appwrite": { - "method": "deleteDocuments", - "weight": 115, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/delete-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", - "rate-limit": 60, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - } - } } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7698,85 +7513,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 53c3efaf07..3d156620d2 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -8000,8 +8000,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8012,8 +8010,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -8095,8 +8092,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8107,8 +8102,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -19290,8 +19284,7 @@ "description": "Project Region.", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -30658,85 +30651,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index a27f5bbdcb..8a9cbd3bb7 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -7560,22 +7560,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -7657,22 +7653,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -22139,85 +22131,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "components": { diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index 2f9375f3b9..4ada970cc8 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -4689,186 +4689,6 @@ } } ] - }, - "patch": { - "summary": "Update documents", - "operationId": "databasesUpdateDocuments", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", - "responses": { - "200": { - "description": "Documents List", - "schema": { - "$ref": "#\/definitions\/documentList" - } - } - }, - "x-appwrite": { - "method": "updateDocuments", - "weight": 113, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/update-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", - "default": [], - "x-example": "{}" - }, - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "default": [], - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - ] - }, - "delete": { - "summary": "Delete documents", - "operationId": "databasesDeleteDocuments", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", - "responses": { - "200": { - "description": "Documents List", - "schema": { - "$ref": "#\/definitions\/documentList" - } - } - }, - "x-appwrite": { - "method": "deleteDocuments", - "weight": 115, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/delete-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", - "rate-limit": 60, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "default": [], - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7897,85 +7717,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index fef7ff4ea5..bb0b97a18a 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -6609,8 +6609,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -6847,8 +6845,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -8189,8 +8185,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8201,8 +8195,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -8282,8 +8275,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8294,8 +8285,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -19756,8 +19746,7 @@ "default": "default", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -31172,85 +31161,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { @@ -37447,13 +37418,16 @@ }, "x-example": [] }, - "imageTransformationsTotal": { - "type": "integer", - "description": "An array of aggregated number of image transformations.", - "x-example": 0, - "format": "int32" - }, "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { "type": "integer", "description": "Total aggregated number of image transformations.", "x-example": 0, @@ -37490,8 +37464,8 @@ "authPhoneCountryBreakdown", "databasesReads", "databasesWrites", - "imageTransformationsTotal", - "imageTransformations" + "imageTransformations", + "imageTransformationsTotal" ] }, "headers": { diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index 3aaf42f08c..ceae14efb3 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -6135,8 +6135,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -6375,8 +6373,6 @@ }, "required": [ "required", - "min", - "max", "default" ] } @@ -7731,22 +7727,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -7826,22 +7818,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -22648,85 +22636,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 2f9375f3b9..4ada970cc8 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -4689,186 +4689,6 @@ } } ] - }, - "patch": { - "summary": "Update documents", - "operationId": "databasesUpdateDocuments", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", - "responses": { - "200": { - "description": "Documents List", - "schema": { - "$ref": "#\/definitions\/documentList" - } - } - }, - "x-appwrite": { - "method": "updateDocuments", - "weight": 113, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/update-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", - "default": [], - "x-example": "{}" - }, - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "default": [], - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - ] - }, - "delete": { - "summary": "Delete documents", - "operationId": "databasesDeleteDocuments", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", - "responses": { - "200": { - "description": "Documents List", - "schema": { - "$ref": "#\/definitions\/documentList" - } - } - }, - "x-appwrite": { - "method": "deleteDocuments", - "weight": 115, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/delete-documents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", - "rate-limit": 60, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "queries": { - "type": "array", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", - "default": [], - "x-example": null, - "items": { - "type": "string" - } - } - } - } - } - ] } }, "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { @@ -7897,85 +7717,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 118750f018..bb0b97a18a 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -8185,8 +8185,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8197,8 +8195,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -8278,8 +8275,6 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, @@ -8290,8 +8285,7 @@ "security": [ { "Project": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -19752,8 +19746,7 @@ "default": "default", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -31168,85 +31161,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index cd0d0955cc..ceae14efb3 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -7727,22 +7727,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -7822,22 +7818,18 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ - "client", - "server", "server" ], "packaging": false, "auth": { "Project": [], - "Session": [] + "Key": [] } }, "security": [ { "Project": [], - "Session": [], - "Key": [], - "JWT": [] + "Key": [] } ], "parameters": [ @@ -22644,85 +22636,67 @@ "tags": [ { "name": "account", - "description": "The Account service allows you to authenticate and manage a user account.", - "x-globalAttributes": [] + "description": "The Account service allows you to authenticate and manage a user account." }, { "name": "avatars", - "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.", - "x-globalAttributes": [] + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." }, { "name": "databases", - "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents", - "x-globalAttributes": [ - "databaseId" - ] + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" }, { "name": "locale", - "description": "The Locale service allows you to customize your app based on your users' location.", - "x-globalAttributes": [] + "description": "The Locale service allows you to customize your app based on your users' location." }, { "name": "health", - "description": "The Health service allows you to both validate and monitor your Appwrite server's health.", - "x-globalAttributes": [] + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." }, { "name": "projects", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "project", - "description": "The Project service allows you to manage all the projects in your Appwrite server.", - "x-globalAttributes": [] + "description": "The Project service allows you to manage all the projects in your Appwrite server." }, { "name": "storage", - "description": "The Storage service allows you to manage your project files.", - "x-globalAttributes": [] + "description": "The Storage service allows you to manage your project files." }, { "name": "teams", - "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources", - "x-globalAttributes": [] + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" }, { "name": "users", - "description": "The Users service allows you to manage your project users.", - "x-globalAttributes": [] + "description": "The Users service allows you to manage your project users." }, { "name": "functions", - "description": "The Functions Service allows you view, create and manage your Cloud Functions.", - "x-globalAttributes": [] + "description": "The Functions Service allows you view, create and manage your Cloud Functions." }, { "name": "proxy", - "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration.", - "x-globalAttributes": [] + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." }, { "name": "graphql", - "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL.", - "x-globalAttributes": [] + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." }, { "name": "console", - "description": "The Console service allows you to interact with console relevant informations.", - "x-globalAttributes": [] + "description": "The Console service allows you to interact with console relevant informations." }, { "name": "migrations", - "description": "The Migrations service allows you to migrate third-party data to your Appwrite project.", - "x-globalAttributes": [] + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." }, { "name": "messaging", - "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.).", - "x-globalAttributes": [] + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." } ], "definitions": { diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index aa25bd37b1..aedec22b8f 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3159,9 +3159,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ - 'databaseId' => ['optional' => false], - 'collectionId' => ['optional' => false], - 'documents' => ['optional' => false], + new Parameter('databaseId', optional: false), + new Parameter('collectionId', optional: false), + new Parameter('documents', optional: false), ] ) ] diff --git a/src/Appwrite/Specification/Format.php b/src/Appwrite/Specification/Format.php index e9377382d2..ecf8fa6eac 100644 --- a/src/Appwrite/Specification/Format.php +++ b/src/Appwrite/Specification/Format.php @@ -415,4 +415,24 @@ abstract class Format } return $values; } + + protected function getNestedModels(Model $model, array &$usedModels): void + { + foreach ($model->getRules() as $rule) { + if (!in_array($model->getType(), $usedModels)) { + continue; + } + $types = (array)$rule['type']; + foreach ($types as $ruleType) { + if (!in_array($ruleType, ['string', 'integer', 'boolean', 'json', 'float'])) { + $usedModels[] = $ruleType; + foreach ($this->models as $m) { + if ($m->getType() === $ruleType) { + $this->getNestedModels($m, $usedModels); + } + } + } + } + } + } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 84feb6adcc..594ef78e5d 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -3,7 +3,9 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -22,41 +24,6 @@ class OpenAPI3 extends Format return 'Open API 3'; } - protected function getNestedModels(Model $model, array &$usedModels): void - { - foreach ($model->getRules() as $rule) { - if (!in_array($model->getType(), $usedModels)) { - continue; - } - - if (\is_array($rule['type'])) { - foreach ($rule['type'] as $ruleType) { - if (!in_array($ruleType, ['string', 'integer', 'boolean', 'json', 'float', 'double'])) { - $usedModels[] = $ruleType; - - foreach ($this->models as $m) { - if ($m->getType() === $ruleType) { - $this->getNestedModels($m, $usedModels); - continue; - } - } - } - } - } else { - if (!in_array($rule['type'], ['string', 'integer', 'boolean', 'json', 'float', 'double'])) { - $usedModels[] = $rule['type']; - - foreach ($this->models as $m) { - if ($m->getType() === $rule['type']) { - $this->getNestedModels($m, $usedModels); - continue; - } - } - } - } - } - } - public function parse(): array { /** @@ -130,20 +97,21 @@ class OpenAPI3 extends Format } $additionalMethods = null; - if (is_array($sdk)) { + if (\is_array($sdk)) { $additionalMethods = $sdk; $sdk = $sdk[0]; } /** - * @var \Appwrite\SDK\Method $sdk + * @var Method $sdk */ - $consumes = [$sdk->getRequestType()]; + $consumes = [$sdk->getRequestType()->value]; $method = $sdk->getMethodName() ?? \uniqid(); - if (!empty($method) && is_array($method)) { - $method = array_keys($method)[0]; + if (!empty($method) && \is_array($method)) { + $method = \array_keys($method)[0]; + \var_dump('WEIRD METHOD: ' . $method); } $desc = $sdk->getDescriptionFilePath(); @@ -156,10 +124,8 @@ class OpenAPI3 extends Format case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case AuthType::KEY: - $sdkPlatforms[] = APP_PLATFORM_SERVER; - break; case AuthType::JWT: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; case AuthType::ADMIN: @@ -202,7 +168,7 @@ class OpenAPI3 extends Format if (!empty($additionalMethods)) { $temp['x-appwrite']['methods'] = []; foreach ($additionalMethods as $method) { - /** @var \Appwrite\SDK\Method $method */ + /** @var Method $method */ $desc = $method->getDescriptionFilePath(); $additionalMethod = [ 'name' => $method->getMethodName(), @@ -212,16 +178,15 @@ class OpenAPI3 extends Format 'description' => ($desc) ? \file_get_contents($desc) : '', ]; - foreach ($method->getParameters() as $name => $param) { - $additionalMethod['parameters'][] = $name; + foreach ($method->getParameters() as $parameter) { + $additionalMethod['parameters'][] = $parameter->getName(); - if (!$param['optional']) { - $additionalMethod['required'][] = $name; + if (!$parameter->isOptional()) { + $additionalMethod['required'][] = $parameter->getName(); } } foreach ($method->getResponses() as $response) { - /** @var \Appwrite\SDK\Response $response */ if (\is_array($response->getModel())) { $additionalMethod['responses'][] = [ 'code' => $response->getCode(), @@ -241,7 +206,7 @@ class OpenAPI3 extends Format // Handle response models foreach ($sdk->getResponses() as $response) { - /** @var \Appwrite\SDK\Response $response */ + /** @var Response $response */ $model = $response->getModel(); foreach ($this->models as $value) { @@ -309,11 +274,11 @@ class OpenAPI3 extends Format } } - if ((!empty($scope))) { // && 'public' != $scope + if ((!empty($scope))) { $securities = ['Project' => []]; foreach ($sdk->getAuth() as $security) { - /** @var \Appwrite\SDK\AuthType $security */ + /** @var AuthType $security */ if (array_key_exists($security->value, $this->keys)) { $securities[$security->value] = []; } diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index bc8d80c2cd..18f88b4643 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -25,26 +25,6 @@ class Swagger2 extends Format return 'Swagger 2'; } - protected function getNestedModels(Model $model, array &$usedModels): void - { - foreach ($model->getRules() as $rule) { - if (!in_array($model->getType(), $usedModels)) { - continue; - } - $types = (array)$rule['type']; - foreach ($types as $ruleType) { - if (!in_array($ruleType, ['string', 'integer', 'boolean', 'json', 'float'])) { - $usedModels[] = $ruleType; - foreach ($this->models as $m) { - if ($m->getType() === $ruleType) { - $this->getNestedModels($m, $usedModels); - } - } - } - } - } - } - public function parse(): array { /* @@ -124,7 +104,7 @@ class Swagger2 extends Format $sdk = $sdk[0]; } - $consumes = [$sdk->getRequestType()]; + $consumes = [$sdk->getRequestType()->value]; $method = $sdk->getMethodName() ?? \uniqid(); From 10c631558988f394bc9ab98212a181e8eccc7568 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Mar 2025 23:00:28 +1300 Subject: [PATCH 112/161] Add doc comments --- app/controllers/api/databases.php | 65 ++++++++++++++++++------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index aedec22b8f..fabafeeef3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3186,26 +3186,37 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $isBulk = true; if (empty($data) && empty($documents)) { + // No single or bulk documents provided throw new Exception(Exception::DOCUMENT_MISSING_DATA); } if (!empty($data) && !empty($documents)) { + // Both single and bulk documents provided throw new Exception(Exception::GENERAL_BAD_REQUEST, 'You can only send one of the following parameters: data, documents'); } if (!empty($data) && empty($documentId)) { + // Single document provided without document ID throw new Exception(Exception::DOCUMENT_MISSING_DATA, 'Document ID is required when creating a single document'); } if (!empty($documents) && !empty($documentId)) { + // Bulk documents provided with document ID throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "documentId" is disallowed when creating multiple documents, set "$id" in each document instead'); } if (!empty($documents) && !empty($permissions)) { + // Bulk documents provided with permissions throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "permissions" is disallowed when creating multiple documents, set "$permissions" in each document instead'); } if (!empty($data)) { + // Single document provided, convert to single item array + // But remember that it was single, to respond with single document $isBulk = false; $documents = [$data]; } + if ($isBulk && \count($documents) > $maxBatchSize) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is limited to ' . $maxBatchSize . ' documents'); + } + $database = Authorization::skip(fn () => $dbForProject->getDocument( 'databases', $databaseId @@ -3233,17 +3244,13 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); } - if ($isBulk && \count($documents) > $maxBatchSize) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is limited to ' . $maxBatchSize . ' documents'); - } + $setPermissions = function (Document $document, ?array $permissions) use ($user, $isAPIKey, $isPrivilegedUser, $isBulk) { + $allowedPermissions = [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]; - $allowedPermissions = [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]; - - $setPermissions = function (Document $document, ?array $permissions) use ($user, $allowedPermissions, $isAPIKey, $isPrivilegedUser, $isBulk) { if ($isBulk) { $permissions = $document['$permissions'] ?? null; } @@ -3367,22 +3374,27 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } }; - $documents = array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId, $setPermissions) { + $documents = \array_map(function ($document) use ($collection, $permissions, $checkPermissions, $isBulk, $documentId, $setPermissions) { $document['$collection'] = $collection->getId(); - if (!$isBulk) { - $document['$id'] = $documentId == 'unique()' ? ID::unique() : $documentId; - } else { - if (empty($document['$id'])) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, '$id must be set in each document when creating bulk documents'); - } + // Determine the source ID depending on whether it's a bulk operation. + $sourceId = $isBulk ? $document['$id'] : $documentId; - $document['$id'] = $document['$id'] == 'unique()' ? ID::unique() : $document['$id']; + // For bulk operations, ensure $id is provided. + if ($isBulk && empty($sourceId)) { + throw new Exception( + Exception::DOCUMENT_INVALID_STRUCTURE, + '$id must be set in each document when creating bulk documents' + ); } + // Assign a unique id if needed, otherwise use the provided id. + $document['$id'] = $sourceId === 'unique()' ? ID::unique() : $sourceId; + $document = new Document($document); $setPermissions($document, $permissions); + $checkPermissions($collection, $document, Database::PERMISSION_CREATE); return $document; @@ -3460,17 +3472,18 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') 'total' => count($documents), 'documents' => $documents ]), Response::MODEL_DOCUMENT_LIST); - } else { - $queueForEvents - ->setParam('documentId', $document->getId()) - ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); - $response->dynamic( - $documents[0], - Response::MODEL_DOCUMENT - ); + return; } + $queueForEvents + ->setParam('documentId', $documents[0]->getId()) + ->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create'); + + $response->dynamic( + $documents[0], + Response::MODEL_DOCUMENT + ); }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents') From 382ffceed97ef9533192a5195fbefc20be16612e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Apr 2025 21:19:12 +1200 Subject: [PATCH 113/161] Lint --- src/Appwrite/Platform/Tasks/Specs.php | 1 - src/Appwrite/SDK/Method.php | 3 +-- src/Appwrite/SDK/Parameter.php | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 1e9f956606..3189383198 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -20,7 +20,6 @@ use Utopia\Config\Config; use Utopia\Database\Adapter\MySQL; use Utopia\Database\Database; use Utopia\Platform\Action; -use Utopia\Registry\Registry; use Utopia\Request as UtopiaRequest; use Utopia\Response as UtopiaResponse; use Utopia\System\System; diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index e1c2508f74..2296250a9e 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -43,8 +43,7 @@ class Method protected ContentType $requestType = ContentType::JSON, protected array $parameters = [], protected array $additionalParameters = [] - ) - { + ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); $this->validateDesc($description); diff --git a/src/Appwrite/SDK/Parameter.php b/src/Appwrite/SDK/Parameter.php index 2a0e463733..cf46e2475a 100644 --- a/src/Appwrite/SDK/Parameter.php +++ b/src/Appwrite/SDK/Parameter.php @@ -19,8 +19,7 @@ class Parameter protected mixed $default = null, protected mixed $validator = null, protected bool $optional = false, - ) - { + ) { } public function getName(): string @@ -72,4 +71,4 @@ class Parameter { $this->optional = $optional; } -} \ No newline at end of file +} From bef10d7c84250dcd31595b5144cb048352c4a229 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 17 Apr 2025 21:36:08 +1200 Subject: [PATCH 114/161] Update specs --- app/config/specs/open-api3-1.6.x-client.json | 62 +- app/config/specs/open-api3-1.6.x-console.json | 535 ++++++++---------- app/config/specs/open-api3-1.6.x-server.json | 354 +++++------- app/config/specs/open-api3-latest-client.json | 56 +- .../specs/open-api3-latest-console.json | 528 ++++++++--------- app/config/specs/open-api3-latest-server.json | 351 +++++------- app/config/specs/swagger2-1.6.x-client.json | 62 +- app/config/specs/swagger2-1.6.x-console.json | 535 ++++++++---------- app/config/specs/swagger2-1.6.x-server.json | 354 +++++------- app/config/specs/swagger2-latest-client.json | 56 +- app/config/specs/swagger2-latest-console.json | 528 ++++++++--------- app/config/specs/swagger2-latest-server.json | 351 +++++------- composer.lock | 14 +- 13 files changed, 1649 insertions(+), 2137 deletions(-) diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index 4135af6c54..cd4d7f8b8b 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -1902,7 +1902,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "schema": { "type": "string", @@ -1922,6 +1922,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -2778,7 +2779,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "schema": { "type": "string", @@ -2798,6 +2799,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -4812,7 +4814,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -4897,7 +4899,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5011,7 +5013,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5084,7 +5086,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5135,7 +5137,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5594,7 +5596,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5676,7 +5678,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -5750,7 +5752,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -5835,7 +5837,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -5932,7 +5934,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6003,7 +6005,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6091,7 +6093,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6157,7 +6159,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6223,7 +6225,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6439,7 +6441,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6512,7 +6514,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6587,7 +6589,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6671,7 +6673,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6732,7 +6734,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -6805,7 +6807,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6868,7 +6870,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -6953,7 +6955,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7063,7 +7065,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7134,7 +7136,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7220,7 +7222,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7293,7 +7295,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7390,7 +7392,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7450,7 +7452,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 3d156620d2..af63d9bd20 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -1917,7 +1917,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "schema": { "type": "string", @@ -1937,6 +1937,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -2786,7 +2787,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "schema": { "type": "string", @@ -2806,6 +2807,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -4295,7 +4297,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 335, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4361,7 +4363,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 334, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -9212,7 +9214,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9284,7 +9286,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9530,7 +9532,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9578,7 +9580,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9627,7 +9629,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 316, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9726,7 +9728,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 317, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9785,7 +9787,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 296, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9856,7 +9858,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9914,7 +9916,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10137,7 +10139,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10197,7 +10199,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10279,7 +10281,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10374,7 +10376,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10442,7 +10444,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10503,7 +10505,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10566,7 +10568,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10650,7 +10652,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10713,7 +10715,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -10785,7 +10787,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10870,7 +10872,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10984,7 +10986,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11048,7 +11050,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11118,7 +11120,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 295, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11199,7 +11201,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11257,7 +11259,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11342,7 +11344,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11410,7 +11412,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11495,7 +11497,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11565,7 +11567,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11616,7 +11618,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11715,7 +11717,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12221,7 +12223,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12261,7 +12263,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12714,67 +12715,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthQueue" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 5000 - }, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -12858,7 +12798,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12906,7 +12846,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13410,7 +13350,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13485,7 +13425,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13628,7 +13568,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13773,7 +13713,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13946,7 +13886,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14123,7 +14063,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14231,7 +14171,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14342,7 +14282,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14394,7 +14334,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14455,7 +14395,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14529,7 +14469,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14603,7 +14543,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14678,7 +14618,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14782,7 +14722,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14889,7 +14829,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14973,7 +14913,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15060,7 +15000,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15174,7 +15114,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15291,7 +15231,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15385,7 +15325,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15482,7 +15422,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15586,7 +15526,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15693,7 +15633,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15835,7 +15775,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15979,7 +15919,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16073,7 +16013,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16170,7 +16110,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16264,7 +16204,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16361,7 +16301,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16455,7 +16395,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16552,7 +16492,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16646,7 +16586,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16743,7 +16683,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16795,7 +16735,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16856,7 +16796,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16930,7 +16870,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17004,7 +16944,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17077,7 +17017,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17159,7 +17099,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17218,7 +17158,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17294,7 +17234,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17355,7 +17295,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17429,7 +17369,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17512,7 +17452,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17601,7 +17541,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17663,7 +17603,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17737,7 +17677,7 @@ }, "x-appwrite": { "method": "list", - "weight": 340, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -17810,7 +17750,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 336, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17897,7 +17837,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 342, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17989,7 +17929,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 337, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18064,7 +18004,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 343, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18135,7 +18075,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 339, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18245,7 +18185,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 345, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18377,7 +18317,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 338, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18481,7 +18421,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 344, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18604,7 +18544,7 @@ }, "x-appwrite": { "method": "get", - "weight": 341, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18661,7 +18601,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 346, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18711,7 +18651,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 347, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18770,7 +18710,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 198, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -18857,7 +18797,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 200, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -18902,7 +18842,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 199, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -18974,7 +18914,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 201, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19031,7 +18971,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 202, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19105,7 +19045,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 203, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19164,7 +19104,7 @@ }, "x-appwrite": { "method": "list", - "weight": 153, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19235,7 +19175,7 @@ }, "x-appwrite": { "method": "create", - "weight": 152, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -19368,7 +19308,7 @@ }, "x-appwrite": { "method": "get", - "weight": 154, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19425,7 +19365,7 @@ }, "x-appwrite": { "method": "update", - "weight": 155, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19539,7 +19479,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 172, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -19598,7 +19538,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 159, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -19689,7 +19629,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 160, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -19767,7 +19707,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 165, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -19845,7 +19785,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 164, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -19923,7 +19863,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 170, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20001,7 +19941,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 163, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20091,7 +20031,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 171, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20172,7 +20112,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 168, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20250,7 +20190,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 167, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20328,7 +20268,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 169, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20406,7 +20346,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 162, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -20484,7 +20424,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 166, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20583,7 +20523,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 184, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -20669,7 +20609,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 180, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -20726,7 +20666,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 179, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -20818,7 +20758,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 181, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -20885,7 +20825,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 182, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -20978,7 +20918,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 183, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21047,7 +20987,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 161, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21107,6 +21047,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -21183,7 +21124,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 186, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21240,7 +21181,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 185, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21358,7 +21299,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 187, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21425,7 +21366,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 188, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21519,7 +21460,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 189, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21588,7 +21529,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 157, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -21687,7 +21628,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 158, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -21765,7 +21706,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 190, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -21882,7 +21823,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 191, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22012,7 +21953,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 156, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22090,7 +22031,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 193, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22313,7 +22254,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 195, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -22576,7 +22517,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 197, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -22801,7 +22742,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 192, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23021,7 +22962,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 194, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23260,7 +23201,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 196, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23482,7 +23423,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 174, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -23539,7 +23480,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 173, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -23653,7 +23594,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 175, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -23720,7 +23661,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 176, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -23835,7 +23776,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 178, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -23904,7 +23845,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 177, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -23973,7 +23914,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 319, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24044,7 +23985,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 318, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24127,7 +24068,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 320, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24177,7 +24118,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 321, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24236,7 +24177,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 322, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24295,7 +24236,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24367,7 +24308,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -24493,7 +24434,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24551,7 +24492,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -24674,7 +24615,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -24734,7 +24675,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -24819,7 +24760,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -24916,7 +24857,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -24987,7 +24928,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25075,7 +25016,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25141,7 +25082,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25207,7 +25148,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25423,7 +25364,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25496,7 +25437,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 218, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25567,7 +25508,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 219, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -25648,7 +25589,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -25723,7 +25664,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -25807,7 +25748,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -25868,7 +25809,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -25941,7 +25882,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26004,7 +25945,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 233, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26076,7 +26017,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26161,7 +26102,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26271,7 +26212,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26342,7 +26283,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26428,7 +26369,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26501,7 +26442,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26597,7 +26538,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26656,7 +26597,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26736,7 +26677,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -26808,7 +26749,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26895,7 +26836,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -26979,7 +26920,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27063,7 +27004,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -27130,7 +27071,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -27190,7 +27131,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27274,7 +27215,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27358,7 +27299,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27472,7 +27413,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27574,7 +27515,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27678,7 +27619,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 276, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -27749,7 +27690,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27800,7 +27741,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -27860,7 +27801,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -27939,7 +27880,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28020,7 +27961,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -28102,7 +28043,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28175,7 +28116,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28235,7 +28176,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -28307,7 +28248,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28382,7 +28323,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28442,7 +28383,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28500,7 +28441,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -28558,7 +28499,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -28618,7 +28559,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -28697,7 +28638,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28776,7 +28717,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28855,7 +28796,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28913,7 +28854,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -28992,7 +28933,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29050,7 +28991,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -29101,7 +29042,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29154,7 +29095,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -29224,7 +29165,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29303,7 +29244,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -29375,7 +29316,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -29484,7 +29425,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29553,7 +29494,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29641,7 +29582,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -29712,7 +29653,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29793,7 +29734,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29872,7 +29813,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -29951,7 +29892,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 281, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30019,7 +29960,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 282, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30103,7 +30044,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 283, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30172,7 +30113,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 284, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30241,7 +30182,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 279, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -30321,7 +30262,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 280, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30399,7 +30340,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 289, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -30487,7 +30428,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 286, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -30560,7 +30501,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 287, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -30610,7 +30551,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 288, + "weight": 287, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index 8a9cbd3bb7..d0e7151fd9 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -2464,7 +2464,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "schema": { "type": "string", @@ -2484,6 +2484,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -8366,7 +8367,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8439,7 +8440,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8686,7 +8687,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8735,7 +8736,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8785,7 +8786,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8844,7 +8845,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9068,7 +9069,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9129,7 +9130,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9212,7 +9213,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9308,7 +9309,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9377,7 +9378,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9439,7 +9440,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9503,7 +9504,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9588,7 +9589,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9652,7 +9653,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9725,7 +9726,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -9812,7 +9813,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9928,7 +9929,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -9994,7 +9995,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10065,7 +10066,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10124,7 +10125,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10210,7 +10211,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10279,7 +10280,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10365,7 +10366,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10436,7 +10437,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10489,7 +10490,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10591,7 +10592,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11106,7 +11107,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11147,7 +11148,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11607,68 +11607,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthQueue" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 5000 - }, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -11753,7 +11691,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11802,7 +11740,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12324,7 +12262,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12400,7 +12338,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12544,7 +12482,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12690,7 +12628,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12864,7 +12802,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13042,7 +12980,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13151,7 +13089,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13263,7 +13201,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13316,7 +13254,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13378,7 +13316,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13453,7 +13391,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13528,7 +13466,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13604,7 +13542,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13709,7 +13647,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -13817,7 +13755,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13902,7 +13840,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13990,7 +13928,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14105,7 +14043,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14223,7 +14161,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14318,7 +14256,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14416,7 +14354,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14521,7 +14459,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14629,7 +14567,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14772,7 +14710,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14917,7 +14855,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15012,7 +14950,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15110,7 +15048,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15205,7 +15143,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15303,7 +15241,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15398,7 +15336,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15496,7 +15434,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15591,7 +15529,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15689,7 +15627,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15742,7 +15680,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15804,7 +15742,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15879,7 +15817,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -15954,7 +15892,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16028,7 +15966,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16111,7 +16049,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16171,7 +16109,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16248,7 +16186,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16310,7 +16248,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16385,7 +16323,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16469,7 +16407,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16560,7 +16498,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16623,7 +16561,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16699,7 +16637,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -16772,7 +16710,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -16899,7 +16837,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -16958,7 +16896,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17082,7 +17020,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17143,7 +17081,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17230,7 +17168,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -17329,7 +17267,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17402,7 +17340,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17492,7 +17430,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17560,7 +17498,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -17628,7 +17566,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -17846,7 +17784,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -17921,7 +17859,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -17998,7 +17936,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18084,7 +18022,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18147,7 +18085,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -18222,7 +18160,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18287,7 +18225,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18374,7 +18312,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18486,7 +18424,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18559,7 +18497,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18647,7 +18585,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -18722,7 +18660,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -18820,7 +18758,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18881,7 +18819,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18963,7 +18901,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19036,7 +18974,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19124,7 +19062,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19209,7 +19147,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19294,7 +19232,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -19362,7 +19300,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -19423,7 +19361,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19508,7 +19446,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -19593,7 +19531,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -19708,7 +19646,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -19811,7 +19749,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19916,7 +19854,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19968,7 +19906,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20029,7 +19967,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -20109,7 +20047,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -20191,7 +20129,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -20274,7 +20212,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20348,7 +20286,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20409,7 +20347,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20482,7 +20420,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -20558,7 +20496,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20619,7 +20557,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -20678,7 +20616,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20737,7 +20675,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -20798,7 +20736,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -20878,7 +20816,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20958,7 +20896,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21038,7 +20976,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -21097,7 +21035,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -21177,7 +21115,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21236,7 +21174,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21288,7 +21226,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21342,7 +21280,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21413,7 +21351,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21493,7 +21431,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -21566,7 +21504,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -21676,7 +21614,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21746,7 +21684,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21835,7 +21773,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -21907,7 +21845,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21989,7 +21927,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22069,7 +22007,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 7f427d7082..cd4d7f8b8b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4814,7 +4814,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -4899,7 +4899,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5013,7 +5013,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5086,7 +5086,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5137,7 +5137,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5596,7 +5596,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5678,7 +5678,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -5752,7 +5752,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -5837,7 +5837,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -5934,7 +5934,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6005,7 +6005,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6093,7 +6093,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6159,7 +6159,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6225,7 +6225,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6441,7 +6441,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6514,7 +6514,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6589,7 +6589,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6673,7 +6673,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6734,7 +6734,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -6807,7 +6807,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6870,7 +6870,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -6955,7 +6955,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7065,7 +7065,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7136,7 +7136,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7222,7 +7222,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7295,7 +7295,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7392,7 +7392,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7452,7 +7452,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index d8beba3ee3..af63d9bd20 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -4297,7 +4297,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 335, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4363,7 +4363,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 334, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -9214,7 +9214,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9286,7 +9286,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9532,7 +9532,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9580,7 +9580,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9629,7 +9629,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 316, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9728,7 +9728,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 317, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9787,7 +9787,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 296, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9858,7 +9858,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9916,7 +9916,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10139,7 +10139,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10199,7 +10199,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10281,7 +10281,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10376,7 +10376,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10444,7 +10444,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10505,7 +10505,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10568,7 +10568,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10652,7 +10652,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10715,7 +10715,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -10787,7 +10787,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10872,7 +10872,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10986,7 +10986,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11050,7 +11050,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11120,7 +11120,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 295, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11201,7 +11201,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11259,7 +11259,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11344,7 +11344,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11412,7 +11412,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11497,7 +11497,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11567,7 +11567,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11618,7 +11618,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11717,7 +11717,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12223,7 +12223,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12263,7 +12263,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12716,67 +12715,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthQueue" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 5000 - }, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -12860,7 +12798,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12908,7 +12846,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13412,7 +13350,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13487,7 +13425,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13630,7 +13568,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13775,7 +13713,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13948,7 +13886,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14125,7 +14063,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14233,7 +14171,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14344,7 +14282,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14396,7 +14334,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14457,7 +14395,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14531,7 +14469,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14605,7 +14543,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14680,7 +14618,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14784,7 +14722,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14891,7 +14829,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14975,7 +14913,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15062,7 +15000,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15176,7 +15114,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15293,7 +15231,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15387,7 +15325,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15484,7 +15422,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15588,7 +15526,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15695,7 +15633,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15837,7 +15775,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15981,7 +15919,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16075,7 +16013,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16172,7 +16110,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16266,7 +16204,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16363,7 +16301,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16457,7 +16395,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16554,7 +16492,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16648,7 +16586,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16745,7 +16683,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16797,7 +16735,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16858,7 +16796,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16932,7 +16870,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17006,7 +16944,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17079,7 +17017,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17161,7 +17099,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17220,7 +17158,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17296,7 +17234,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17357,7 +17295,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17431,7 +17369,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17514,7 +17452,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17603,7 +17541,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17665,7 +17603,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17739,7 +17677,7 @@ }, "x-appwrite": { "method": "list", - "weight": 340, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -17812,7 +17750,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 336, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17899,7 +17837,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 342, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17991,7 +17929,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 337, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18066,7 +18004,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 343, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18137,7 +18075,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 339, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18247,7 +18185,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 345, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18379,7 +18317,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 338, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18483,7 +18421,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 344, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18606,7 +18544,7 @@ }, "x-appwrite": { "method": "get", - "weight": 341, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18663,7 +18601,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 346, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18713,7 +18651,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 347, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18772,7 +18710,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 198, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -18859,7 +18797,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 200, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -18904,7 +18842,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 199, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -18976,7 +18914,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 201, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19033,7 +18971,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 202, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19107,7 +19045,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 203, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19166,7 +19104,7 @@ }, "x-appwrite": { "method": "list", - "weight": 153, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19237,7 +19175,7 @@ }, "x-appwrite": { "method": "create", - "weight": 152, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -19370,7 +19308,7 @@ }, "x-appwrite": { "method": "get", - "weight": 154, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19427,7 +19365,7 @@ }, "x-appwrite": { "method": "update", - "weight": 155, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19541,7 +19479,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 172, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -19600,7 +19538,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 159, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -19691,7 +19629,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 160, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -19769,7 +19707,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 165, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -19847,7 +19785,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 164, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -19925,7 +19863,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 170, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20003,7 +19941,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 163, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20093,7 +20031,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 171, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20174,7 +20112,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 168, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20252,7 +20190,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 167, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20330,7 +20268,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 169, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20408,7 +20346,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 162, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -20486,7 +20424,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 166, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20585,7 +20523,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 184, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -20671,7 +20609,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 180, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -20728,7 +20666,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 179, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -20820,7 +20758,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 181, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -20887,7 +20825,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 182, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -20980,7 +20918,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 183, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21049,7 +20987,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 161, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21186,7 +21124,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 186, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21243,7 +21181,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 185, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21361,7 +21299,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 187, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21428,7 +21366,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 188, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21522,7 +21460,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 189, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21591,7 +21529,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 157, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -21690,7 +21628,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 158, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -21768,7 +21706,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 190, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -21885,7 +21823,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 191, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22015,7 +21953,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 156, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22093,7 +22031,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 193, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22316,7 +22254,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 195, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -22579,7 +22517,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 197, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -22804,7 +22742,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 192, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23024,7 +22962,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 194, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23263,7 +23201,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 196, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23485,7 +23423,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 174, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -23542,7 +23480,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 173, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -23656,7 +23594,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 175, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -23723,7 +23661,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 176, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -23838,7 +23776,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 178, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -23907,7 +23845,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 177, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -23976,7 +23914,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 319, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24047,7 +23985,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 318, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24130,7 +24068,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 320, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24180,7 +24118,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 321, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24239,7 +24177,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 322, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24298,7 +24236,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24370,7 +24308,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -24496,7 +24434,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24554,7 +24492,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -24677,7 +24615,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -24737,7 +24675,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -24822,7 +24760,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -24919,7 +24857,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -24990,7 +24928,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25078,7 +25016,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25144,7 +25082,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25210,7 +25148,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25426,7 +25364,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25499,7 +25437,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 218, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25570,7 +25508,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 219, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -25651,7 +25589,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -25726,7 +25664,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -25810,7 +25748,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -25871,7 +25809,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -25944,7 +25882,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26007,7 +25945,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 233, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26079,7 +26017,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26164,7 +26102,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26274,7 +26212,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26345,7 +26283,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26431,7 +26369,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26504,7 +26442,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26600,7 +26538,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26659,7 +26597,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26739,7 +26677,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -26811,7 +26749,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26898,7 +26836,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -26982,7 +26920,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27066,7 +27004,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -27133,7 +27071,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -27193,7 +27131,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27277,7 +27215,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27361,7 +27299,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27475,7 +27413,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27577,7 +27515,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27681,7 +27619,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 276, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -27752,7 +27690,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27803,7 +27741,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -27863,7 +27801,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -27942,7 +27880,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28023,7 +27961,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -28105,7 +28043,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28178,7 +28116,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28238,7 +28176,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -28310,7 +28248,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28385,7 +28323,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28445,7 +28383,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28503,7 +28441,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -28561,7 +28499,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -28621,7 +28559,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -28700,7 +28638,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28779,7 +28717,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28858,7 +28796,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28916,7 +28854,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -28995,7 +28933,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29053,7 +28991,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -29104,7 +29042,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29157,7 +29095,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -29227,7 +29165,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29306,7 +29244,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -29378,7 +29316,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -29487,7 +29425,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29556,7 +29494,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29644,7 +29582,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -29715,7 +29653,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29796,7 +29734,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29875,7 +29813,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -29954,7 +29892,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 281, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30022,7 +29960,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 282, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30106,7 +30044,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 283, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30175,7 +30113,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 284, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30244,7 +30182,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 279, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -30324,7 +30262,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 280, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30402,7 +30340,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 289, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -30490,7 +30428,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 286, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -30563,7 +30501,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 287, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -30613,7 +30551,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 288, + "weight": 287, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 7bde2fde6c..d0e7151fd9 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -8367,7 +8367,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8440,7 +8440,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8687,7 +8687,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8736,7 +8736,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8786,7 +8786,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8845,7 +8845,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9069,7 +9069,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9130,7 +9130,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9213,7 +9213,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9309,7 +9309,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9378,7 +9378,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9440,7 +9440,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9504,7 +9504,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9589,7 +9589,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9653,7 +9653,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9726,7 +9726,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -9813,7 +9813,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9929,7 +9929,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -9995,7 +9995,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10066,7 +10066,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10125,7 +10125,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10211,7 +10211,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10280,7 +10280,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10366,7 +10366,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10437,7 +10437,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10490,7 +10490,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10592,7 +10592,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11107,7 +11107,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11148,7 +11148,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11608,68 +11607,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthQueue" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 5000 - }, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -11754,7 +11691,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11803,7 +11740,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12325,7 +12262,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12401,7 +12338,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12545,7 +12482,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12691,7 +12628,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12865,7 +12802,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13043,7 +12980,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13152,7 +13089,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13264,7 +13201,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13317,7 +13254,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13379,7 +13316,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13454,7 +13391,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13529,7 +13466,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13605,7 +13542,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13710,7 +13647,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -13818,7 +13755,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13903,7 +13840,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13991,7 +13928,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14106,7 +14043,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14224,7 +14161,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14319,7 +14256,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14417,7 +14354,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14522,7 +14459,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14630,7 +14567,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14773,7 +14710,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14918,7 +14855,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15013,7 +14950,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15111,7 +15048,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15206,7 +15143,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15304,7 +15241,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15399,7 +15336,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15497,7 +15434,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15592,7 +15529,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15690,7 +15627,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15743,7 +15680,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15805,7 +15742,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15880,7 +15817,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -15955,7 +15892,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16029,7 +15966,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16112,7 +16049,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16172,7 +16109,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16249,7 +16186,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16311,7 +16248,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16386,7 +16323,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16470,7 +16407,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16561,7 +16498,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16624,7 +16561,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16700,7 +16637,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -16773,7 +16710,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -16900,7 +16837,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -16959,7 +16896,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17083,7 +17020,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17144,7 +17081,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17231,7 +17168,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -17330,7 +17267,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17403,7 +17340,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17493,7 +17430,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17561,7 +17498,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -17629,7 +17566,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -17847,7 +17784,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -17922,7 +17859,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -17999,7 +17936,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18085,7 +18022,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18148,7 +18085,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -18223,7 +18160,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18288,7 +18225,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18375,7 +18312,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18487,7 +18424,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18560,7 +18497,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18648,7 +18585,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -18723,7 +18660,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -18821,7 +18758,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18882,7 +18819,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18964,7 +18901,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19037,7 +18974,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19125,7 +19062,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19210,7 +19147,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19295,7 +19232,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -19363,7 +19300,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -19424,7 +19361,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19509,7 +19446,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -19594,7 +19531,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -19709,7 +19646,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -19812,7 +19749,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19917,7 +19854,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19969,7 +19906,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20030,7 +19967,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -20110,7 +20047,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -20192,7 +20129,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -20275,7 +20212,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20349,7 +20286,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20410,7 +20347,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20483,7 +20420,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -20559,7 +20496,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20620,7 +20557,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -20679,7 +20616,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20738,7 +20675,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -20799,7 +20736,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -20879,7 +20816,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20959,7 +20896,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21039,7 +20976,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -21098,7 +21035,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -21178,7 +21115,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21237,7 +21174,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21289,7 +21226,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21343,7 +21280,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21414,7 +21351,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21494,7 +21431,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -21567,7 +21504,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -21677,7 +21614,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21747,7 +21684,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21836,7 +21773,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -21908,7 +21845,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21990,7 +21927,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22070,7 +22007,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index 4ada970cc8..07d400f4e4 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -2028,7 +2028,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "type": "string", "x-example": "amazon", @@ -2047,6 +2047,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -2932,7 +2933,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "type": "string", "x-example": "amazon", @@ -2951,6 +2952,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -4979,7 +4981,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5061,7 +5063,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5179,7 +5181,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5250,7 +5252,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5323,7 +5325,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5820,7 +5822,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5904,7 +5906,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -5976,7 +5978,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6058,7 +6060,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -6149,7 +6151,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6218,7 +6220,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6306,7 +6308,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6377,7 +6379,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6448,7 +6450,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6647,7 +6649,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6718,7 +6720,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6792,7 +6794,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6883,7 +6885,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6944,7 +6946,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7018,7 +7020,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7081,7 +7083,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7163,7 +7165,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7277,7 +7279,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7346,7 +7348,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7431,7 +7433,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7502,7 +7504,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7597,7 +7599,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7657,7 +7659,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index bb0b97a18a..da44535f5a 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -2059,7 +2059,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "type": "string", "x-example": "amazon", @@ -2078,6 +2078,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -2956,7 +2957,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "type": "string", "x-example": "amazon", @@ -2975,6 +2976,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -4499,7 +4501,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 335, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4568,7 +4570,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 334, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -9357,7 +9359,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9428,7 +9430,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9698,7 +9700,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9748,7 +9750,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9799,7 +9801,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 316, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +9896,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 317, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9953,7 +9955,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 296, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10024,7 +10026,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -10082,7 +10084,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10322,7 +10324,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10382,7 +10384,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10461,7 +10463,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10552,7 +10554,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10618,7 +10620,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10679,7 +10681,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10744,7 +10746,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10825,7 +10827,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10893,7 +10895,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -10963,7 +10965,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11045,7 +11047,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11163,7 +11165,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11227,7 +11229,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11295,7 +11297,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 295, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11374,7 +11376,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11432,7 +11434,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11517,7 +11519,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11583,7 +11585,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11668,7 +11670,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11736,7 +11738,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11809,7 +11811,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11932,7 +11934,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12444,7 +12446,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12483,7 +12485,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12933,67 +12934,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { - "$ref": "#\/definitions\/healthQueue" - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "type": "integer", - "format": "int32", - "default": 5000, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -13079,7 +13019,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13129,7 +13069,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13653,7 +13593,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13727,7 +13667,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13884,7 +13824,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14038,7 +13978,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14232,7 +14172,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14425,7 +14365,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14542,7 +14482,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14657,7 +14597,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14711,7 +14651,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14772,7 +14712,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14845,7 +14785,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14918,7 +14858,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14992,7 +14932,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15106,7 +15046,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15218,7 +15158,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15308,7 +15248,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15396,7 +15336,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15522,7 +15462,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15646,7 +15586,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15748,7 +15688,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15848,7 +15788,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15962,7 +15902,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16074,7 +16014,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16232,7 +16172,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16387,7 +16327,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16489,7 +16429,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16589,7 +16529,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16691,7 +16631,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16791,7 +16731,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16893,7 +16833,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16993,7 +16933,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17095,7 +17035,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -17195,7 +17135,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17249,7 +17189,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17310,7 +17250,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17383,7 +17323,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17456,7 +17396,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17528,7 +17468,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17617,7 +17557,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17676,7 +17616,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17754,7 +17694,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17815,7 +17755,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17888,7 +17828,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17968,7 +17908,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -18057,7 +17997,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18119,7 +18059,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18191,7 +18131,7 @@ }, "x-appwrite": { "method": "list", - "weight": 340, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18263,7 +18203,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 336, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18356,7 +18296,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 342, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18443,7 +18383,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 337, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18522,7 +18462,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 343, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18592,7 +18532,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 339, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18712,7 +18652,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 345, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18831,7 +18771,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 338, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18944,7 +18884,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 344, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19056,7 +18996,7 @@ }, "x-appwrite": { "method": "get", - "weight": 341, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -19113,7 +19053,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 346, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19165,7 +19105,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 347, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19224,7 +19164,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 198, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19307,7 +19247,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 200, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19354,7 +19294,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 199, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19430,7 +19370,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 201, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19487,7 +19427,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 202, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19563,7 +19503,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 203, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19622,7 +19562,7 @@ }, "x-appwrite": { "method": "list", - "weight": 153, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19692,7 +19632,7 @@ }, "x-appwrite": { "method": "create", - "weight": 152, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -19840,7 +19780,7 @@ }, "x-appwrite": { "method": "get", - "weight": 154, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19897,7 +19837,7 @@ }, "x-appwrite": { "method": "update", - "weight": 155, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20021,7 +19961,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 172, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20080,7 +20020,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 159, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20171,7 +20111,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 160, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20248,7 +20188,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 165, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20325,7 +20265,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 164, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20402,7 +20342,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 170, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20479,7 +20419,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 163, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20570,7 +20510,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 171, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20650,7 +20590,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 168, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20727,7 +20667,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 167, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20804,7 +20744,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 169, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20881,7 +20821,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 162, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -20958,7 +20898,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 166, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -21054,7 +20994,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 184, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21140,7 +21080,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 180, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21197,7 +21137,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 179, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -21290,7 +21230,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 181, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21355,7 +21295,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 182, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21449,7 +21389,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 183, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21516,7 +21456,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 161, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21574,6 +21514,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -21654,7 +21595,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 186, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21711,7 +21652,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 185, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21832,7 +21773,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 187, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21897,7 +21838,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 188, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21993,7 +21934,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 189, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22060,7 +22001,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 157, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22159,7 +22100,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 158, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22236,7 +22177,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 190, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22364,7 +22305,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 191, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22501,7 +22442,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 156, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22578,7 +22519,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 193, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22797,7 +22738,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 195, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23059,7 +23000,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 197, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23280,7 +23221,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 192, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23496,7 +23437,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 194, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23730,7 +23671,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 196, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23948,7 +23889,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 174, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24005,7 +23946,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 173, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24124,7 +24065,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 175, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24189,7 +24130,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 176, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24309,7 +24250,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 178, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24376,7 +24317,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 177, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24443,7 +24384,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 319, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24513,7 +24454,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 318, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24601,7 +24542,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 320, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24653,7 +24594,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 321, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24712,7 +24653,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 322, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24771,7 +24712,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24842,7 +24783,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -24980,7 +24921,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25038,7 +24979,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25170,7 +25111,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -25230,7 +25171,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25312,7 +25253,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -25403,7 +25344,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25472,7 +25413,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25560,7 +25501,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25631,7 +25572,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25702,7 +25643,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25901,7 +25842,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25972,7 +25913,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 218, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26043,7 +25984,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 219, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26122,7 +26063,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26196,7 +26137,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26287,7 +26228,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -26348,7 +26289,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -26422,7 +26363,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26485,7 +26426,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 233, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26556,7 +26497,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26638,7 +26579,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26752,7 +26693,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26821,7 +26762,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26906,7 +26847,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26977,7 +26918,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27071,7 +27012,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27130,7 +27071,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27209,7 +27150,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -27280,7 +27221,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27374,7 +27315,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27464,7 +27405,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27554,7 +27495,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -27622,7 +27563,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -27682,7 +27623,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27772,7 +27713,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27862,7 +27803,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27987,7 +27928,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -28098,7 +28039,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28209,7 +28150,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 276, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28280,7 +28221,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -28333,7 +28274,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -28393,7 +28334,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -28471,7 +28412,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28552,7 +28493,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -28633,7 +28574,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28705,7 +28646,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28765,7 +28706,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -28838,7 +28779,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28911,7 +28852,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28971,7 +28912,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29029,7 +28970,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29087,7 +29028,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29147,7 +29088,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29225,7 +29166,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29303,7 +29244,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -29381,7 +29322,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -29439,7 +29380,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -29517,7 +29458,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29575,7 +29516,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -29628,7 +29569,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29683,7 +29624,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -29751,7 +29692,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29829,7 +29770,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -29900,7 +29841,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -30012,7 +29953,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30079,7 +30020,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -30168,7 +30109,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -30237,7 +30178,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30318,7 +30259,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30396,7 +30337,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30474,7 +30415,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 281, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30540,7 +30481,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 282, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30624,7 +30565,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 283, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30691,7 +30632,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 284, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30758,7 +30699,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 279, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -30834,7 +30775,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 280, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30913,7 +30854,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 289, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -30998,7 +30939,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 286, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31070,7 +31011,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 287, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31122,7 +31063,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 288, + "weight": 287, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index ceae14efb3..19214d2588 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -2628,7 +2628,7 @@ "parameters": [ { "name": "provider", - "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", "required": true, "type": "string", "x-example": "amazon", @@ -2647,6 +2647,7 @@ "dropbox", "etsy", "facebook", + "figma", "github", "gitlab", "google", @@ -8508,7 +8509,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8580,7 +8581,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8851,7 +8852,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8902,7 +8903,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8954,7 +8955,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9013,7 +9014,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9254,7 +9255,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9315,7 +9316,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9395,7 +9396,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9487,7 +9488,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9554,7 +9555,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9616,7 +9617,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9682,7 +9683,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9764,7 +9765,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9833,7 +9834,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9904,7 +9905,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -9988,7 +9989,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10108,7 +10109,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10174,7 +10175,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10243,7 +10244,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10302,7 +10303,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10388,7 +10389,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10455,7 +10456,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10541,7 +10542,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10610,7 +10611,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10685,7 +10686,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10811,7 +10812,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11332,7 +11333,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11372,7 +11373,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11829,68 +11829,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { - "$ref": "#\/definitions\/healthQueue" - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "type": "integer", - "format": "int32", - "default": 5000, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -11977,7 +11915,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12028,7 +11966,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12570,7 +12508,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12645,7 +12583,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12803,7 +12741,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12958,7 +12896,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13153,7 +13091,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13347,7 +13285,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13465,7 +13403,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13581,7 +13519,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13636,7 +13574,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13698,7 +13636,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13772,7 +13710,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13846,7 +13784,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13921,7 +13859,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14036,7 +13974,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14149,7 +14087,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14240,7 +14178,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14329,7 +14267,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14456,7 +14394,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14581,7 +14519,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14684,7 +14622,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14785,7 +14723,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14900,7 +14838,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15013,7 +14951,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15172,7 +15110,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15328,7 +15266,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15431,7 +15369,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15532,7 +15470,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15635,7 +15573,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15736,7 +15674,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15839,7 +15777,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15940,7 +15878,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16043,7 +15981,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16144,7 +16082,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16199,7 +16137,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16261,7 +16199,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16335,7 +16273,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16409,7 +16347,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16482,7 +16420,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16572,7 +16510,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16632,7 +16570,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16711,7 +16649,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16773,7 +16711,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16847,7 +16785,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16928,7 +16866,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17019,7 +16957,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17082,7 +17020,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17156,7 +17094,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17228,7 +17166,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17367,7 +17305,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17426,7 +17364,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17559,7 +17497,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17620,7 +17558,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17704,7 +17642,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -17797,7 +17735,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17868,7 +17806,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17958,7 +17896,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -18031,7 +17969,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18104,7 +18042,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18305,7 +18243,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18378,7 +18316,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18454,7 +18392,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18547,7 +18485,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18610,7 +18548,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -18686,7 +18624,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18751,7 +18689,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18835,7 +18773,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18951,7 +18889,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19022,7 +18960,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19109,7 +19047,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19182,7 +19120,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19278,7 +19216,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -19339,7 +19277,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19420,7 +19358,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19492,7 +19430,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19587,7 +19525,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19678,7 +19616,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19769,7 +19707,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -19838,7 +19776,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -19899,7 +19837,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19990,7 +19928,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20081,7 +20019,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20207,7 +20145,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20319,7 +20257,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20431,7 +20369,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -20485,7 +20423,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20546,7 +20484,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -20625,7 +20563,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -20707,7 +20645,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -20789,7 +20727,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20862,7 +20800,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20923,7 +20861,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20997,7 +20935,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21071,7 +21009,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21132,7 +21070,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21191,7 +21129,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21250,7 +21188,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21311,7 +21249,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21390,7 +21328,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21469,7 +21407,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21548,7 +21486,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -21607,7 +21545,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -21686,7 +21624,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21745,7 +21683,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21799,7 +21737,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21855,7 +21793,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21924,7 +21862,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -22003,7 +21941,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -22075,7 +22013,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22188,7 +22126,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22256,7 +22194,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -22346,7 +22284,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -22416,7 +22354,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22498,7 +22436,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22577,7 +22515,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index c6debc90af..07d400f4e4 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4981,7 +4981,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5063,7 +5063,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5181,7 +5181,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5252,7 +5252,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5325,7 +5325,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5822,7 +5822,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5906,7 +5906,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -5978,7 +5978,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6060,7 +6060,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -6151,7 +6151,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6220,7 +6220,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6308,7 +6308,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6379,7 +6379,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6450,7 +6450,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6649,7 +6649,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6720,7 +6720,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6794,7 +6794,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6885,7 +6885,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6946,7 +6946,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7020,7 +7020,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7083,7 +7083,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7165,7 +7165,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7279,7 +7279,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7348,7 +7348,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7433,7 +7433,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7504,7 +7504,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7599,7 +7599,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7659,7 +7659,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 4091877406..da44535f5a 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -4501,7 +4501,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 335, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4570,7 +4570,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 334, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -9359,7 +9359,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9430,7 +9430,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9700,7 +9700,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9750,7 +9750,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9801,7 +9801,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 316, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9896,7 +9896,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 317, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9955,7 +9955,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 296, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10026,7 +10026,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -10084,7 +10084,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10324,7 +10324,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10384,7 +10384,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10463,7 +10463,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -10554,7 +10554,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10620,7 +10620,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10681,7 +10681,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10746,7 +10746,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10827,7 +10827,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10895,7 +10895,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -10965,7 +10965,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11047,7 +11047,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11165,7 +11165,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11229,7 +11229,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11297,7 +11297,7 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 295, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -11376,7 +11376,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11434,7 +11434,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11519,7 +11519,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11585,7 +11585,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11670,7 +11670,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11738,7 +11738,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11811,7 +11811,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11934,7 +11934,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12446,7 +12446,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12485,7 +12485,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12935,67 +12934,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { - "$ref": "#\/definitions\/healthQueue" - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "type": "integer", - "format": "int32", - "default": 5000, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -13081,7 +13019,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13131,7 +13069,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13655,7 +13593,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13729,7 +13667,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13886,7 +13824,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14040,7 +13978,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14234,7 +14172,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14427,7 +14365,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14544,7 +14482,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14659,7 +14597,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14713,7 +14651,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14774,7 +14712,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14847,7 +14785,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14920,7 +14858,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14994,7 +14932,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15108,7 +15046,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15220,7 +15158,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15310,7 +15248,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15398,7 +15336,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15524,7 +15462,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15648,7 +15586,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15750,7 +15688,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15850,7 +15788,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15964,7 +15902,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16076,7 +16014,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16234,7 +16172,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16389,7 +16327,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16491,7 +16429,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16591,7 +16529,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16693,7 +16631,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16793,7 +16731,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16895,7 +16833,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16995,7 +16933,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17097,7 +17035,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -17197,7 +17135,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17251,7 +17189,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17312,7 +17250,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17385,7 +17323,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17458,7 +17396,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17530,7 +17468,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17619,7 +17557,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17678,7 +17616,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17756,7 +17694,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17817,7 +17755,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17890,7 +17828,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17970,7 +17908,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -18059,7 +17997,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18121,7 +18059,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18193,7 +18131,7 @@ }, "x-appwrite": { "method": "list", - "weight": 340, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18265,7 +18203,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 336, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18358,7 +18296,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 342, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18445,7 +18383,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 337, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18524,7 +18462,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 343, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18594,7 +18532,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 339, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18714,7 +18652,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 345, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18833,7 +18771,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 338, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18946,7 +18884,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 344, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19058,7 +18996,7 @@ }, "x-appwrite": { "method": "get", - "weight": 341, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -19115,7 +19053,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 346, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19167,7 +19105,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 347, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19226,7 +19164,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 198, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19309,7 +19247,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 200, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19356,7 +19294,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 199, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19432,7 +19370,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 201, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19489,7 +19427,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 202, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19565,7 +19503,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 203, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19624,7 +19562,7 @@ }, "x-appwrite": { "method": "list", - "weight": 153, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19694,7 +19632,7 @@ }, "x-appwrite": { "method": "create", - "weight": 152, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -19842,7 +19780,7 @@ }, "x-appwrite": { "method": "get", - "weight": 154, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19899,7 +19837,7 @@ }, "x-appwrite": { "method": "update", - "weight": 155, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -20023,7 +19961,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 172, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20082,7 +20020,7 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 159, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20173,7 +20111,7 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 160, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20250,7 +20188,7 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 165, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20327,7 +20265,7 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 164, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20404,7 +20342,7 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 170, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20481,7 +20419,7 @@ }, "x-appwrite": { "method": "updateMembershipsPrivacy", - "weight": 163, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20572,7 +20510,7 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 171, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20652,7 +20590,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 168, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20729,7 +20667,7 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 167, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20806,7 +20744,7 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 169, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20883,7 +20821,7 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 162, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -20960,7 +20898,7 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 166, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -21056,7 +20994,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 184, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21142,7 +21080,7 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 180, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21199,7 +21137,7 @@ }, "x-appwrite": { "method": "createKey", - "weight": 179, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -21292,7 +21230,7 @@ }, "x-appwrite": { "method": "getKey", - "weight": 181, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21357,7 +21295,7 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 182, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21451,7 +21389,7 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 183, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21518,7 +21456,7 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 161, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -21657,7 +21595,7 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 186, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21714,7 +21652,7 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 185, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21835,7 +21773,7 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 187, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21900,7 +21838,7 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 188, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21996,7 +21934,7 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 189, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22063,7 +22001,7 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 157, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22162,7 +22100,7 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 158, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22239,7 +22177,7 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 190, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22367,7 +22305,7 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 191, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22504,7 +22442,7 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 156, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -22581,7 +22519,7 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 193, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22800,7 +22738,7 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 195, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23062,7 +23000,7 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 197, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23283,7 +23221,7 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 192, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -23499,7 +23437,7 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 194, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23733,7 +23671,7 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 196, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23951,7 +23889,7 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 174, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24008,7 +23946,7 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 173, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -24127,7 +24065,7 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 175, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24192,7 +24130,7 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 176, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24312,7 +24250,7 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 178, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24379,7 +24317,7 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 177, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24446,7 +24384,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 319, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24516,7 +24454,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 318, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24604,7 +24542,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 320, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24656,7 +24594,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 321, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24715,7 +24653,7 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 322, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24774,7 +24712,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24845,7 +24783,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -24983,7 +24921,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25041,7 +24979,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25173,7 +25111,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -25233,7 +25171,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25315,7 +25253,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -25406,7 +25344,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25475,7 +25413,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25563,7 +25501,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25634,7 +25572,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25705,7 +25643,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25904,7 +25842,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25975,7 +25913,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 218, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -26046,7 +25984,7 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 219, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26125,7 +26063,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26199,7 +26137,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26290,7 +26228,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -26351,7 +26289,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -26425,7 +26363,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26488,7 +26426,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 233, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26559,7 +26497,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26641,7 +26579,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26755,7 +26693,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26824,7 +26762,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26909,7 +26847,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26980,7 +26918,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27074,7 +27012,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27133,7 +27071,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27212,7 +27150,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -27283,7 +27221,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27377,7 +27315,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27467,7 +27405,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27557,7 +27495,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -27625,7 +27563,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -27685,7 +27623,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27775,7 +27713,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27865,7 +27803,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27990,7 +27928,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -28101,7 +28039,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28212,7 +28150,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 276, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28283,7 +28221,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -28336,7 +28274,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -28396,7 +28334,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -28474,7 +28412,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -28555,7 +28493,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -28636,7 +28574,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28708,7 +28646,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28768,7 +28706,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -28841,7 +28779,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28914,7 +28852,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28974,7 +28912,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29032,7 +28970,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29090,7 +29028,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29150,7 +29088,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29228,7 +29166,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29306,7 +29244,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -29384,7 +29322,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -29442,7 +29380,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -29520,7 +29458,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29578,7 +29516,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -29631,7 +29569,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29686,7 +29624,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -29754,7 +29692,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29832,7 +29770,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -29903,7 +29841,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -30015,7 +29953,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30082,7 +30020,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -30171,7 +30109,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -30240,7 +30178,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30321,7 +30259,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30399,7 +30337,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30477,7 +30415,7 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 281, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30543,7 +30481,7 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 282, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30627,7 +30565,7 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 283, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30694,7 +30632,7 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 284, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30761,7 +30699,7 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 279, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -30837,7 +30775,7 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 280, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30916,7 +30854,7 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 289, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -31001,7 +30939,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 286, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31073,7 +31011,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 287, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31125,7 +31063,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 288, + "weight": 287, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 0c62ccda0b..19214d2588 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -8509,7 +8509,7 @@ }, "x-appwrite": { "method": "list", - "weight": 291, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8581,7 +8581,7 @@ }, "x-appwrite": { "method": "create", - "weight": 290, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8852,7 +8852,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 292, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8903,7 +8903,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 293, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8955,7 +8955,7 @@ }, "x-appwrite": { "method": "get", - "weight": 294, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9014,7 +9014,7 @@ }, "x-appwrite": { "method": "update", - "weight": 297, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9255,7 +9255,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 300, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9316,7 +9316,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 302, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9396,7 +9396,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 301, + "weight": 300, "cookies": false, "type": "upload", "deprecated": false, @@ -9488,7 +9488,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 303, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9555,7 +9555,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 299, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9617,7 +9617,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 304, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9683,7 +9683,7 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 305, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9765,7 +9765,7 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 306, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9834,7 +9834,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 298, + "weight": 297, "cookies": false, "type": "location", "deprecated": false, @@ -9905,7 +9905,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 308, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -9989,7 +9989,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 307, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10109,7 +10109,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 309, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10175,7 +10175,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 310, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10244,7 +10244,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 312, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10303,7 +10303,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 311, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10389,7 +10389,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 313, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10456,7 +10456,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 314, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10542,7 +10542,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 315, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10611,7 +10611,7 @@ }, "x-appwrite": { "method": "query", - "weight": 333, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10686,7 +10686,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 332, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10812,7 +10812,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 149, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11333,7 +11333,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 150, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11373,7 +11373,6 @@ "v1-functions", "v1-stats-resources", "v1-stats-usage", - "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11830,68 +11829,6 @@ ] } }, - "\/health\/queue\/stats-usage-dump": { - "get": { - "summary": "Get usage dump queue", - "operationId": "healthGetQueueStatsUsageDump", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.", - "responses": { - "200": { - "description": "Health Queue", - "schema": { - "$ref": "#\/definitions\/healthQueue" - } - } - }, - "x-appwrite": { - "method": "getQueueStatsUsageDump", - "weight": 146, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue-stats-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ], - "parameters": [ - { - "name": "threshold", - "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", - "required": false, - "type": "integer", - "format": "int32", - "default": 5000, - "in": "query" - } - ] - } - }, "\/health\/queue\/webhooks": { "get": { "summary": "Get webhooks queue", @@ -11978,7 +11915,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 148, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12029,7 +11966,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 147, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12571,7 +12508,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 386, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12646,7 +12583,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 383, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12804,7 +12741,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 390, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12959,7 +12896,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 385, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13154,7 +13091,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 392, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13348,7 +13285,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 384, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13466,7 +13403,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 391, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13582,7 +13519,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 389, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13637,7 +13574,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 393, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13699,7 +13636,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 387, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13773,7 +13710,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 388, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13847,7 +13784,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 358, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13922,7 +13859,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 357, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14037,7 +13974,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 370, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14150,7 +14087,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 356, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14241,7 +14178,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 369, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14330,7 +14267,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 348, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14457,7 +14394,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 361, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14582,7 +14519,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 351, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14685,7 +14622,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 364, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14786,7 +14723,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 349, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14901,7 +14838,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 362, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15014,7 +14951,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 350, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15173,7 +15110,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 363, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15329,7 +15266,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 352, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15432,7 +15369,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 365, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15533,7 +15470,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 353, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15636,7 +15573,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 366, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15737,7 +15674,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 354, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15840,7 +15777,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 367, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15941,7 +15878,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 355, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16044,7 +15981,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 368, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16145,7 +16082,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 360, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16200,7 +16137,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 371, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16262,7 +16199,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 359, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16336,7 +16273,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 380, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16410,7 +16347,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 373, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16483,7 +16420,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 372, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16573,7 +16510,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 375, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16633,7 +16570,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 376, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16712,7 +16649,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 377, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16774,7 +16711,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 374, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16848,7 +16785,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 379, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16929,7 +16866,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 378, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17020,7 +16957,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 381, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17083,7 +17020,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 382, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17157,7 +17094,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 205, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17229,7 +17166,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 204, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17368,7 +17305,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 206, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17427,7 +17364,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 207, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17560,7 +17497,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 208, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17621,7 +17558,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 210, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17705,7 +17642,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 209, + "weight": 208, "cookies": false, "type": "upload", "deprecated": false, @@ -17798,7 +17735,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 211, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17869,7 +17806,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 216, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17959,7 +17896,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 217, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -18032,7 +17969,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 213, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18105,7 +18042,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 212, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18306,7 +18243,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 214, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18379,7 +18316,7 @@ }, "x-appwrite": { "method": "list", - "weight": 221, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18455,7 +18392,7 @@ }, "x-appwrite": { "method": "create", - "weight": 220, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18548,7 +18485,7 @@ }, "x-appwrite": { "method": "get", - "weight": 222, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18611,7 +18548,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 224, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -18687,7 +18624,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 226, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18752,7 +18689,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 228, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18836,7 +18773,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 227, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18952,7 +18889,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 229, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19023,7 +18960,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 230, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19110,7 +19047,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 232, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19183,7 +19120,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 231, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19279,7 +19216,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 223, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -19340,7 +19277,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 225, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19421,7 +19358,7 @@ }, "x-appwrite": { "method": "list", - "weight": 243, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -19493,7 +19430,7 @@ }, "x-appwrite": { "method": "create", - "weight": 234, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19588,7 +19525,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 237, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19679,7 +19616,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 235, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19770,7 +19707,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 251, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -19839,7 +19776,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 274, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -19900,7 +19837,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 236, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19991,7 +19928,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 239, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20082,7 +20019,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 240, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20208,7 +20145,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 241, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20320,7 +20257,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 238, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20432,7 +20369,7 @@ }, "x-appwrite": { "method": "get", - "weight": 244, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -20486,7 +20423,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 272, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -20547,7 +20484,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 257, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -20626,7 +20563,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 275, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -20708,7 +20645,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 253, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -20790,7 +20727,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 249, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20863,7 +20800,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 248, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20924,7 +20861,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 262, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20998,7 +20935,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 267, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21072,7 +21009,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 263, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21133,7 +21070,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 264, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21192,7 +21129,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 266, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21251,7 +21188,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 265, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21312,7 +21249,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 255, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21391,7 +21328,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 256, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21470,7 +21407,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 258, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -21549,7 +21486,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 245, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -21608,7 +21545,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 260, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -21687,7 +21624,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 247, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21746,7 +21683,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 268, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21800,7 +21737,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 271, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21856,7 +21793,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 270, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21925,7 +21862,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 252, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -22004,7 +21941,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 250, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -22076,7 +22013,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 242, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22189,7 +22126,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 246, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22257,7 +22194,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 261, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -22347,7 +22284,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 273, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -22417,7 +22354,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 269, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22499,7 +22436,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 259, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22578,7 +22515,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 254, + "weight": 253, "cookies": false, "type": "", "deprecated": false, diff --git a/composer.lock b/composer.lock index b89e843b34..d621cf7030 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "51ff891ef6cee8a3f8c4e5187b7fd479", + "content-hash": "07f497ddfd04aec838a812bdc60131de", "packages": [ { "name": "adhocore/jwt", @@ -4107,16 +4107,16 @@ }, { "name": "utopia-php/pools", - "version": "0.8.0", + "version": "0.8.2", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "60733929dc328e7ea47e800579c8bbf0d49df5ba" + "reference": "05c67aba42eb68ac65489cc1e7fc5db83db2dd4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/60733929dc328e7ea47e800579c8bbf0d49df5ba", - "reference": "60733929dc328e7ea47e800579c8bbf0d49df5ba", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/05c67aba42eb68ac65489cc1e7fc5db83db2dd4d", + "reference": "05c67aba42eb68ac65489cc1e7fc5db83db2dd4d", "shasum": "" }, "require": { @@ -4153,9 +4153,9 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/0.8.0" + "source": "https://github.com/utopia-php/pools/tree/0.8.2" }, - "time": "2025-03-19T10:22:03+00:00" + "time": "2025-04-17T02:04:54+00:00" }, { "name": "utopia-php/preloader", From 0ab1ebd8c40db59d9acf9c5678227643f89e6fb0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:07:56 +1200 Subject: [PATCH 115/161] Validate create batch size inline --- app/controllers/api/databases.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 51841123e6..4dee2380ef 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3227,14 +3227,13 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('documents', [], new ArrayList(new JSON(), APP_LIMIT_DOCUMENTS_CREATE), 'Array of documents data as JSON object.', true) + ->param('documents', [], fn (int $limit) => new ArrayList(new JSON(), $limit), 'Array of documents data as JSON object.', optional: true, injections: ['maxBatchSize']) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') ->inject('user') ->inject('queueForEvents') ->inject('queueForStatsUsage') - ->inject('maxBatchSize') ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, int $maxBatchSize) { $data = \is_string($data) ? \json_decode($data, true) @@ -3270,10 +3269,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = [$data]; } - if ($isBulk && \count($documents) > $maxBatchSize) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is limited to ' . $maxBatchSize . ' documents'); - } - $database = Authorization::skip(fn () => $dbForProject->getDocument( 'databases', $databaseId @@ -3447,11 +3442,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') // Assign a unique id if needed, otherwise use the provided id. $document['$id'] = $sourceId === 'unique()' ? ID::unique() : $sourceId; - $document = new Document($document); - $setPermissions($document, $permissions); - $checkPermissions($collection, $document, Database::PERMISSION_CREATE); return $document; @@ -3460,8 +3452,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') try { $dbForProject->createDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $documents, - $maxBatchSize + $documents ); } catch (StructureException $e) { throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); From f82726c2b4fb03f88d8a9215c73871e31b39368a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:08:38 +1200 Subject: [PATCH 116/161] Remove redundant batch size passing --- app/controllers/api/databases.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4dee2380ef..79d927a943 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4225,8 +4225,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->inject('maxBatchSize') - ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, int $maxBatchSize) { + ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -4256,7 +4255,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ); if ($hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk update is not supported for collections with relationship attributes'); } try { @@ -4307,7 +4306,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, $queries, - $maxBatchSize ) ); @@ -4515,8 +4513,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') - ->inject('maxBatchSize') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, int $maxBatchSize) { + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -4538,7 +4535,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ); if ($hasRelationships) { - throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for collections with relationship attributes'); + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk delete is not supported for collections with relationship attributes'); } try { @@ -4547,13 +4544,12 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $documents = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $queries, $maxBatchSize) { - return $dbForProject->deleteDocuments( + $documents = $dbForProject->withRequestTimestamp($requestTimestamp, fn() => + $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries, - $maxBatchSize - ); - }); + $queries + ) + ); // DB Storage Calculation $queueForStatsUsage From 6af3912eff08057539c5f4b6591a517cf7e77fbf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:08:53 +1200 Subject: [PATCH 117/161] Remove unused value --- app/init/constants.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/init/constants.php b/app/init/constants.php index e5ed1f9abc..4f2fe359aa 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -26,7 +26,6 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls -const APP_LIMIT_DOCUMENTS_CREATE = 5_000; // Default maximum of how many documents can be inserted in a single request const APP_LIMIT_DATABASE_BATCH = 1_000; // Default batch size for database operations const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours From a98520302d03c07263c48b06aecb7f4635ff0715 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:09:02 +1200 Subject: [PATCH 118/161] Reduce max batch --- app/init/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/init/constants.php b/app/init/constants.php index 4f2fe359aa..d7676d36ac 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -26,7 +26,7 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls -const APP_LIMIT_DATABASE_BATCH = 1_000; // Default batch size for database operations +const APP_LIMIT_DATABASE_BATCH = 100; // Default maximum batch size for database operations const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours From 453bb8ab70b6dd97ac8d3e6eff2ec4bb5c222abe Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:09:13 +1200 Subject: [PATCH 119/161] Update tests for changes --- .../e2e/Services/Databases/DatabasesBase.php | 485 +++++++++--------- 1 file changed, 235 insertions(+), 250 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 71448bab4f..dc9ea4a70f 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4999,6 +4999,10 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); + $this->assertEquals(1, $response['body']['documents'][0]['number']); + $this->assertEquals(2, $response['body']['documents'][1]['number']); + $this->assertEquals(3, $response['body']['documents'][2]['number']); + $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(3, $response['body']['documents']); @@ -5019,7 +5023,6 @@ trait DatabasesBase ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('You can only send one of the following parameters: data, documents', $response['body']['message']); // TEST FAIL - Can't use $documentId and create bulk documents $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ @@ -5069,19 +5072,18 @@ trait DatabasesBase $this->assertEquals(400, $response['headers']['status-code']); - // TEST FAIL - Can't push more than 10000 documents + // TEST FAIL - Can't push more than APP_LIMIT_DATABASE_BATCH documents $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'documents' => array_fill(0, 10001, [ + 'documents' => array_fill(0, APP_LIMIT_DATABASE_BATCH + 1, [ '$id' => ID::unique(), 'number' => 1, ]), ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `documents` param: Value must a valid array no longer than 10000 items and Value must be a valid JSON string', $response['body']['message']); } public function testBulkCreateRelationships(): void @@ -5132,17 +5134,6 @@ trait DatabasesBase $collection1 = $collection1['body']['$id']; $collection2 = $collection2['body']['$id']; - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_MANY, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_RESTRICT, - ]); - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -5163,7 +5154,18 @@ trait DatabasesBase 'required' => true, ]); - sleep(3); + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'relatedCollectionId' => $collection2, + 'type' => Database::RELATION_ONE_TO_MANY, + 'key' => 'collection2', + 'onDelete' => Database::RELATION_MUTATE_RESTRICT, + ]); + + sleep(2); $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ 'content-type' => 'application/json', @@ -5201,24 +5203,232 @@ trait DatabasesBase ], ]); - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertCount(2, $response['body']['documents']); + $this->assertEquals(400, $response['headers']['status-code']); + } - $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ + public function testBulkUpdates(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Updates' + ]); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['total']); + $this->assertNotEmpty($database['body']['$id']); - $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collection2}/documents", array_merge([ + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Updates', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // Wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + $documents = []; + + for ($x = 1; $x <= $amount; $x++) { + $documents[] = [ + '$id' => ID::unique(), + 'number' => $x, + ]; + } + + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + }; + + $createBulkDocuments(); + + // TEST: Update all documents + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100 + ], + 'permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(4, $response['body']['total']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [100])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + $this->assertEquals($collection['body']['$id'], $document['$collectionId']); + $this->assertEquals($data['databaseId'], $document['$databaseId']); + } + + // TEST: Check permissions persist + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 200 + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [200])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + } + + // TEST: Update documents with limit + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::limit(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [200])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(5, $documents['body']['total']); + + // TEST: Update documents with offset + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [300])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + // TEST: Update documents with equals filter + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 400 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [400])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); } public function testBulkDeletes(): void @@ -5871,229 +6081,4 @@ trait DatabasesBase $this->assertEquals(200, $collection2docs['headers']['status-code']); $this->assertEquals(0, $collection2docs['body']['total']); } - - public function testBulkUpdates(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Updates' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Updates', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - // wait for database worker to create attributes - sleep(2); - - // Create documents - $createBulkDocuments = function ($amount = 10) use ($data) { - $documents = []; - - for ($x = 1; $x <= $amount; $x++) { - $documents[] = [ - '$id' => ID::unique(), - 'number' => $x, - ]; - } - - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => $documents, - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - }; - - $createBulkDocuments(); - - // TEST: Update all documents - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 100 - ], - 'permissions' => [ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - Query::equal('number', [100])->toString(), - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - foreach ($documents['body']['documents'] as $document) { - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $document['$permissions']); - $this->assertEquals($collection['body']['$id'], $document['$collectionId']); - $this->assertEquals($data['databaseId'], $document['$databaseId']); - } - - // TEST: Check permissions persist - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 200 - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - Query::equal('number', [200])->toString(), - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - foreach ($documents['body']['documents'] as $document) { - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $document['$permissions']); - } - - // TEST: Update documents with limit - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 300 - ], - 'queries' => [ - Query::limit(5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [200])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(5, $documents['body']['total']); - - // TEST: Update documents with offset - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 300 - ], - 'queries' => [ - Query::offset(5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [300])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - // TEST: Update documents with equals filter - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 400 - ], - 'queries' => [ - Query::equal('number', [300])->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [400])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - } } From 38f5d88b031f6e0f7a66fc231c76a1712073d6f9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 12:44:15 +1200 Subject: [PATCH 120/161] Remove unused param --- app/controllers/api/databases.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 79d927a943..7302b6c23f 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3234,7 +3234,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForStatsUsage') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, int $maxBatchSize) { + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -3264,7 +3264,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') if (!empty($data)) { // Single document provided, convert to single item array - // But remember that it was single, to respond with single document + // But remember that it was single to respond with a single document $isBulk = false; $documents = [$data]; } @@ -4544,7 +4544,9 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $documents = $dbForProject->withRequestTimestamp($requestTimestamp, fn() => + $documents = $dbForProject->withRequestTimestamp( + $requestTimestamp, + fn () => $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries From f2270b9ef83aab58bc052d116d285e767810ec80 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 14:22:48 +1200 Subject: [PATCH 121/161] Add read/write counts for bulk operations --- app/controllers/api/databases.php | 57 ++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 7302b6c23f..703db56096 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4225,7 +4225,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('requestTimestamp') ->inject('response') ->inject('dbForProject') - ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject) { + ->inject('queueForStatsUsage') + ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -4309,7 +4310,11 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ) ); - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $operations = 0; + + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { + $operations++; + $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -4345,10 +4350,16 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $processDocument($collection, $document); } - $response->dynamic(new Document([ - 'total' => \count($documents), - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + + $response + ->addHeader('X-Debug-Operations', $operations) + ->dynamic(new Document([ + 'total' => \count($documents), + 'documents' => $documents + ]), Response::MODEL_DOCUMENT_LIST); }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') @@ -4419,8 +4430,12 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu throw new Exception(Exception::COLLECTION_NOT_FOUND); } + $operations = 0; + // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { + $operations++; + $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -4455,10 +4470,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $processDocument($collection, $document); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); // per collection - - $response->addHeader('X-Debug-Operations', 1); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $relationships = \array_map( fn ($document) => $document->getAttribute('key'), @@ -4553,15 +4566,15 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ) ); - // DB Storage Calculation - $queueForStatsUsage - ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection + $operations = 0; - $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database): bool { + $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { return false; } + $operations++; + $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -4603,10 +4616,16 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') return true; }); - $response->dynamic(new Document([ - 'total' => \count($documents), - 'documents' => $documents, - ]), Response::MODEL_DOCUMENT_LIST); + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + + $response + ->addHeader('X-Debug-Operations', $operations) + ->dynamic(new Document([ + 'total' => \count($documents), + 'documents' => $documents, + ]), Response::MODEL_DOCUMENT_LIST); }); App::get('/v1/databases/usage') From 27ac5cbb2a0ebd0df1f10038d79753db5b0544ae Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 17:40:47 +1200 Subject: [PATCH 122/161] Remove redundant withTimestamp --- app/controllers/api/account.php | 18 ++++++++---------- app/controllers/api/databases.php | 30 +++++++++++------------------- app/controllers/api/teams.php | 4 +--- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 0016ad6660..baf4b3e92b 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -719,9 +719,7 @@ App::delete('/v1/account/sessions/:sessionId') continue; } - $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $session) { - return $dbForProject->deleteDocument('sessions', $session->getId()); - }); + $dbForProject->deleteDocument('sessions', $session->getId()); unset($sessions[$key]); @@ -2770,7 +2768,7 @@ App::patch('/v1/account/name') $user->setAttribute('name', $name); - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); $queueForEvents->setParam('userId', $user->getId()); @@ -2845,7 +2843,7 @@ App::patch('/v1/account/password') ->setAttribute('hash', Auth::DEFAULT_ALGO) ->setAttribute('hashOptions', Auth::DEFAULT_ALGO_OPTIONS); - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); $queueForEvents->setParam('userId', $user->getId()); @@ -2930,7 +2928,7 @@ App::patch('/v1/account/email') } try { - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); /** * @var Document $oldTarget */ @@ -3016,7 +3014,7 @@ App::patch('/v1/account/phone') } try { - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); /** * @var Document $oldTarget */ @@ -3066,7 +3064,7 @@ App::patch('/v1/account/prefs') $user->setAttribute('prefs', $prefs); - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); $queueForEvents->setParam('userId', $user->getId()); @@ -3104,7 +3102,7 @@ App::patch('/v1/account/status') $user->setAttribute('status', false); - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); $queueForEvents ->setParam('userId', $user->getId()) @@ -3868,7 +3866,7 @@ App::patch('/v1/account/mfa') $user->setAttribute('mfa', $mfa); - $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); + $user = $dbForProject->updateDocument('users', $user->getId(), $user); if ($mfa) { $factors = $session->getAttribute('factors', []); diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 703db56096..070b0ec867 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3469,7 +3469,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('database', $database); // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database) { + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -4122,13 +4122,10 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $response->addHeader('X-Debug-Operations', $operations); try { - $document = $dbForProject->withRequestTimestamp( - $requestTimestamp, - fn () => $dbForProject->updateDocument( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $document->getId(), - $newDocument - ) + $document = $dbForProject->updateDocument( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $document->getId(), + $newDocument ); } catch (AuthorizationException) { throw new Exception(Exception::USER_UNAUTHORIZED); @@ -4175,8 +4172,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $processDocument($collection, $document); - $response->dynamic($document, Response::MODEL_DOCUMENT); - $relationships = \array_map( fn ($document) => $document->getAttribute('key'), \array_filter( @@ -4192,6 +4187,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->setContext('collection', $collection) ->setContext('database', $database) ->setPayload($response->getPayload(), sensitive: $relationships); + + $response->dynamic($document, Response::MODEL_DOCUMENT); }); App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') @@ -4420,12 +4417,10 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu } try { - $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $documentId) { - $dbForProject->deleteDocument( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $documentId - ); - }); + $dbForProject->deleteDocument( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $documentId + ); } catch (NotFoundException $e) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4489,9 +4484,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->setContext('database', $database) ->setPayload($response->output($document, Response::MODEL_DOCUMENT), sensitive: $relationships); - $queueForStatsUsage - ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection - $response->noContent(); }); diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 2389a7d52e..dd64fe0768 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -322,9 +322,7 @@ App::put('/v1/teams/:teamId') ->setAttribute('name', $name) ->setAttribute('search', implode(' ', [$teamId, $name])); - $team = $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $team) { - return $dbForProject->updateDocument('teams', $team->getId(), $team); - }); + $team = $dbForProject->updateDocument('teams', $team->getId(), $team); $queueForEvents->setParam('teamId', $team->getId()); From 7b88792b6acfc6912922359d13a1a5f37d269bae Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 30 Apr 2025 17:40:54 +1200 Subject: [PATCH 123/161] Accumulate documents --- app/controllers/api/databases.php | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 070b0ec867..6c3d390dba 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4298,13 +4298,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $partialDocument = new Document($data); - $documents = $dbForProject->withRequestTimestamp( - $requestTimestamp, - fn () => $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $partialDocument, - $queries, - ) + $documents = []; + + $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $partialDocument, + $queries, + onNext: function (Document $document) use (&$documents) { + $documents[] = $document; + }, ); $operations = 0; @@ -4549,13 +4551,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $documents = $dbForProject->withRequestTimestamp( - $requestTimestamp, - fn () => - $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries - ) + $documents = []; + + $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries, + onNext: function (Document $document) use (&$documents) { + $documents[] = $document; + }, ); $operations = 0; From df5fb87925672ac4247755a381111f9493588e58 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 3 May 2025 01:55:17 +1200 Subject: [PATCH 124/161] Update DB --- composer.json | 2 +- composer.lock | 138 +++++++++++++++++++++++++++----------------------- 2 files changed, 75 insertions(+), 65 deletions(-) diff --git a/composer.json b/composer.json index 7288bc0164..045ded3d2b 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "utopia-php/abuse": "0.52.*", "utopia-php/analytics": "0.10.*", "utopia-php/audit": "0.55.*", - "utopia-php/cache": "0.12.*", + "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", "utopia-php/database": "0.66.*", diff --git a/composer.lock b/composer.lock index 78392ded42..824b2f2f72 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cd57aa71022e7468451b893243e06b8f", + "content-hash": "b8243e4ebfdde65a47d6d5c712554313", "packages": [ { "name": "adhocore/jwt", @@ -2726,19 +2726,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -2786,7 +2787,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -2802,11 +2803,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php82", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php82.git", @@ -2862,7 +2863,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php82/tree/v1.32.0" }, "funding": [ { @@ -3300,16 +3301,16 @@ }, { "name": "utopia-php/cache", - "version": "0.12.0", + "version": "0.13.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "646038f1d470b759c129348be8fc14da3c00bbd9" + "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/646038f1d470b759c129348be8fc14da3c00bbd9", - "reference": "646038f1d470b759c129348be8fc14da3c00bbd9", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/dee01dec33a211644d60f6cfa56b1b8176d3fae3", + "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3", "shasum": "" }, "require": { @@ -3317,6 +3318,7 @@ "ext-memcached": "*", "ext-redis": "*", "php": ">=8.0", + "utopia-php/pools": "0.8.*", "utopia-php/telemetry": "0.1.*" }, "require-dev": { @@ -3345,9 +3347,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.12.0" + "source": "https://github.com/utopia-php/cache/tree/0.13.0" }, - "time": "2025-02-25T09:09:21+00:00" + "time": "2025-04-17T04:20:26+00:00" }, { "name": "utopia-php/cli", @@ -3497,23 +3499,23 @@ }, { "name": "utopia-php/database", - "version": "0.66.0", + "version": "0.66.4", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "67d2ab418efba31dc76b3564cf043e2b3f98d027" + "reference": "0d4dc51c767f2307d8555574712dc6adaf893b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/67d2ab418efba31dc76b3564cf043e2b3f98d027", - "reference": "67d2ab418efba31dc76b3564cf043e2b3f98d027", + "url": "https://api.github.com/repos/utopia-php/database/zipball/0d4dc51c767f2307d8555574712dc6adaf893b9a", + "reference": "0d4dc51c767f2307d8555574712dc6adaf893b9a", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-pdo": "*", "php": ">=8.1", - "utopia-php/cache": "0.12.*", + "utopia-php/cache": "0.13.*", "utopia-php/framework": "0.33.*", "utopia-php/pools": "0.8.*" }, @@ -3547,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.66.0" + "source": "https://github.com/utopia-php/database/tree/0.66.4" }, - "time": "2025-04-16T07:10:27+00:00" + "time": "2025-05-01T04:44:17+00:00" }, { "name": "utopia-php/domains", @@ -3951,16 +3953,16 @@ }, { "name": "utopia-php/migration", - "version": "0.9.2", + "version": "0.9.3", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "8a56e928d6ccb5958a5b80ac27286d969f11a6b0" + "reference": "e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/8a56e928d6ccb5958a5b80ac27286d969f11a6b0", - "reference": "8a56e928d6ccb5958a5b80ac27286d969f11a6b0", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd", + "reference": "e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd", "shasum": "" }, "require": { @@ -4001,9 +4003,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.9.2" + "source": "https://github.com/utopia-php/migration/tree/0.9.3" }, - "time": "2025-04-22T16:09:28+00:00" + "time": "2025-05-01T05:41:26+00:00" }, { "name": "utopia-php/orchestration", @@ -4543,28 +4545,28 @@ }, { "name": "utopia-php/vcs", - "version": "0.9.4", + "version": "0.9.5", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a" + "reference": "055956545ca7ab4e8688df5de1df3e2833859793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/1a8d280b176acc99ea8d9e7364b8767cbb206b4a", - "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/055956545ca7ab4e8688df5de1df3e2833859793", + "reference": "055956545ca7ab4e8688df5de1df3e2833859793", "shasum": "" }, "require": { "adhocore/jwt": "^1.1", "php": ">=8.0", - "utopia-php/cache": "0.12.*", + "utopia-php/cache": "0.13.*", "utopia-php/framework": "0.*.*", "utopia-php/system": "0.9.*" }, "require-dev": { - "laravel/pint": "1.2.*", - "phpstan/phpstan": "1.8.*", + "laravel/pint": "1.*.*", + "phpstan/phpstan": "1.*.*", "phpunit/phpunit": "^9.4" }, "type": "library", @@ -4587,9 +4589,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.9.4" + "source": "https://github.com/utopia-php/vcs/tree/0.9.5" }, - "time": "2025-03-13T10:09:45+00:00" + "time": "2025-04-17T04:38:49+00:00" }, { "name": "utopia-php/websocket", @@ -5935,16 +5937,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", "shasum": "" }, "require": { @@ -5955,7 +5957,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -6018,7 +6020,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" }, "funding": [ { @@ -6029,12 +6031,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-05-02T06:40:34+00:00" }, { "name": "psr/cache", @@ -7146,16 +7156,16 @@ }, { "name": "symfony/console", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88" + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88", + "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", "shasum": "" }, "require": { @@ -7219,7 +7229,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.5" + "source": "https://github.com/symfony/console/tree/v7.2.6" }, "funding": [ { @@ -7235,7 +7245,7 @@ "type": "tidelift" } ], - "time": "2025-03-12T08:11:12+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/filesystem", @@ -7436,7 +7446,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -7495,7 +7505,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -7515,7 +7525,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -7573,7 +7583,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -7593,7 +7603,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -7654,7 +7664,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -7674,7 +7684,7 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -7730,7 +7740,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" }, "funding": [ { @@ -7811,16 +7821,16 @@ }, { "name": "symfony/string", - "version": "v7.2.0", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", "shasum": "" }, "require": { @@ -7878,7 +7888,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" + "source": "https://github.com/symfony/string/tree/v7.2.6" }, "funding": [ { @@ -7894,7 +7904,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:26+00:00" + "time": "2025-04-20T20:18:16+00:00" }, { "name": "textalk/websocket", From f52f864085dad2234344acf11b3210edb0412d30 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 15:04:32 +1200 Subject: [PATCH 125/161] Get limit directly from plan --- app/controllers/api/databases.php | 2 +- app/init/resources.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6c3d390dba..12fd25cd7c 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3227,7 +3227,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('documents', [], fn (int $limit) => new ArrayList(new JSON(), $limit), 'Array of documents data as JSON object.', optional: true, injections: ['maxBatchSize']) + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan']) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') diff --git a/app/init/resources.php b/app/init/resources.php index adf6c3f2b2..c719a47344 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -843,7 +843,3 @@ App::setResource('apiKey', function (Request $request, Document $project): ?Key }, ['request', 'project']); App::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); - -App::setResource('maxBatchSize', function () { - return APP_LIMIT_DATABASE_BATCH; -}); From 384e606503722a283b01ff80d0a7716df7d51318 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 16:52:06 +1200 Subject: [PATCH 126/161] Fix bulk update relationship test --- .../Databases/DatabasesCustomClientTest.php | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 279657201b..e60e79a778 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -1352,42 +1352,7 @@ class DatabasesCustomClientTest extends Scope ] ]); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - - $document2 = $response['body']['documents'][0]; - - $this->assertEquals('Document 2', $document2['name']); - $this->assertEquals('Document 1 Updated', $document2['collection1']['name']); - - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'data' => [ - 'name' => 'Document 2 Updated', - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents/' . $document1, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals('Document 1 Updated', $response['body']['name']); - - $document2 = $response['body']['collection2'][0]; - $this->assertEquals('Document 2 Updated', $document2['name']); + $this->assertEquals(400, $response['headers']['status-code']); } public function testBulkDeletesPermissions(): void From 1f08344c8dd0b0e62706a7ff5b50998c933248bf Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 17:01:05 +1200 Subject: [PATCH 127/161] Fix update test --- .../e2e/Services/Databases/DatabasesBase.php | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index dc9ea4a70f..5f1194b5ec 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -2362,38 +2362,6 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); - /** - * Test for failure - */ - - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-timestamp' => 'invalid', - ], $this->getHeaders()), [ - 'data' => [ - 'title' => 'Thor: Ragnarok', - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid X-Appwrite-Timestamp header value', $response['body']['message']); - $this->assertEquals(Exception::GENERAL_ARGUMENT_INVALID, $response['body']['type']); - - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $id, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-timestamp' => DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -1000)), - ], $this->getHeaders()), [ - 'data' => [ - 'title' => 'Thor: Ragnarok', - ], - ]); - - $this->assertEquals(409, $response['headers']['status-code']); - $this->assertEquals('Remote document is newer than local.', $response['body']['message']); - $this->assertEquals(Exception::DOCUMENT_UPDATE_CONFLICT, $response['body']['type']); - return []; } From 808f338c7c8407dd3e4500ef62af50d2135740a9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 17:20:24 +1200 Subject: [PATCH 128/161] Fix all bulk/relationship tests --- .../e2e/Services/Databases/DatabasesBase.php | 359 +----------------- 1 file changed, 6 insertions(+), 353 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 5f1194b5ec..ab661b055d 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5453,10 +5453,10 @@ trait DatabasesBase sleep(2); // Create documents - $createBulkDocuments = function ($amount = 10) use ($data) { + $createBulkDocuments = function ($amount = 11) use ($data) { $documents = []; - for ($x = 0; $x <= $amount; $x++) { + for ($x = 0; $x < $amount; $x++) { $documents[] = [ '$id' => ID::unique(), 'number' => $x, @@ -5669,8 +5669,8 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(5, $response['body']['total']); - // SUCCESS: Delete over 1k documents - $createBulkDocuments(1000); + // SUCCESS: Delete 100 documents + $createBulkDocuments(100); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5678,7 +5678,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(1001, $documents['body']['total']); + $this->assertEquals(100, $documents['body']['total']); $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5686,7 +5686,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1001, $response['body']['total']); + $this->assertEquals(100, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5702,351 +5702,4 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); } - - public function testBulkDeletesRelationshipRestrict() - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Deletes' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection1', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection2', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection1 = $collection1['body']['$id']; - $collection2 = $collection2['body']['$id']; - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_MANY, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_RESTRICT, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - sleep(3); - - $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Document 1', - 'collection2' => [ - [ - 'name' => 'Document 2', - ], - ], - ], - ]); - - $this->assertEquals(201, $document1['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(403, $response['headers']['status-code']); - $this->assertEquals('document_delete_restricted', $response['body']['type']); - } - - public function testBulkDeletesRelationshipNull() - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Deletes' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection1', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection2', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection1 = $collection1['body']['$id']; - $collection2 = $collection2['body']['$id']; - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_MANY, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_SET_NULL, - 'twoWay' => true, - 'twoWayKey' => 'collection1', - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - sleep(3); - - $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Document 1', - 'collection2' => [ - [ - 'name' => 'Document 2', - ], - ], - ], - ]); - - $this->assertEquals(201, $document1['headers']['status-code']); - - $document2 = $document1['body']['collection2'][0]['$id']; - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - - $document2 = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents/' . $document2, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $document2['headers']['status-code']); - $this->assertEmpty($document2['body']['collection1']); - } - - public function testBulkDeletesRelationshipCascade() - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Deletes' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection1', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection2', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection1 = $collection1['body']['$id']; - $collection2 = $collection2['body']['$id']; - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_ONE, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_CASCADE - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - sleep(3); - - for ($i = 0; $i < 5; $i++) { - $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Document 1', - 'collection2' => [ - 'name' => 'Document 2', - ], - ], - ]); - - $this->assertEquals(201, $document1['headers']['status-code']); - } - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - - $collection1docs = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $collection1docs['headers']['status-code']); - $this->assertEquals(0, $collection1docs['body']['total']); - - $collection2docs = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collection2 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders())); - - $this->assertEquals(200, $collection2docs['headers']['status-code']); - $this->assertEquals(0, $collection2docs['body']['total']); - } } From 2f091a1fab2b5423ecc7c06026c6082933e0b480 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 21:45:30 +1200 Subject: [PATCH 129/161] Fix permissions set --- tests/e2e/Services/Databases/DatabasesBase.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index ab661b055d..02c0c835e5 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5257,13 +5257,13 @@ trait DatabasesBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'data' => [ - 'number' => 100 + 'number' => 100, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] ], - 'permissions' => [ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] ]); $this->assertEquals(200, $response['headers']['status-code']); From 21d9f182d692eb72b6c6391fc42213217197e240 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 22:30:20 +1200 Subject: [PATCH 130/161] Remove dump --- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index d024ed723e..68db229c44 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -114,7 +114,6 @@ class OpenAPI3 extends Format if (!empty($method) && \is_array($method)) { $method = \array_keys($method)[0]; - \var_dump('WEIRD METHOD: ' . $method); } $desc = $sdk->getDescriptionFilePath(); From 24229c63ea433009904bf7aa6903bef0c031ed20 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 23:26:59 +1200 Subject: [PATCH 131/161] Fix multi-method graphql parameter mapping --- app/config/specs/open-api3-1.6.x-client.json | 2 +- app/config/specs/open-api3-1.6.x-console.json | 2 +- app/config/specs/open-api3-1.6.x-server.json | 2 +- app/config/specs/open-api3-latest-client.json | 2 +- app/config/specs/open-api3-latest-console.json | 2 +- app/config/specs/open-api3-latest-server.json | 2 +- app/config/specs/swagger2-1.6.x-client.json | 2 +- app/config/specs/swagger2-1.6.x-console.json | 2 +- app/config/specs/swagger2-1.6.x-server.json | 2 +- app/config/specs/swagger2-latest-client.json | 2 +- app/config/specs/swagger2-latest-console.json | 2 +- app/config/specs/swagger2-latest-server.json | 2 +- src/Appwrite/GraphQL/Types/Mapper.php | 14 ++++++++++---- src/Appwrite/SDK/Parameter.php | 2 +- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/SDK/Specification/Format/Swagger2.php | 2 +- 16 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index 3cb2c5276b..8cc9129dee 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -4555,7 +4555,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 2bbaa9bcf2..1b0dc1c247 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -8046,7 +8046,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index bcc780ded6..7d8f6bd09f 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -7597,7 +7597,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 3cb2c5276b..8cc9129dee 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4555,7 +4555,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 2bbaa9bcf2..1b0dc1c247 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8046,7 +8046,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index bcc780ded6..7d8f6bd09f 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7597,7 +7597,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "x-example": null, "items": { "type": "object" diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index 12c3ff1b7f..308895a819 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -4692,7 +4692,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index 46d071b844..3c9d98b0c7 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -8174,7 +8174,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index e7dcfc707e..7119a8f584 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -7713,7 +7713,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 12c3ff1b7f..308895a819 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4692,7 +4692,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 46d071b844..3c9d98b0c7 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8174,7 +8174,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index e7dcfc707e..7119a8f584 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7713,7 +7713,7 @@ }, "documents": { "type": "array", - "description": "Array of documents data as JSON object.", + "description": "Array of documents data as JSON objects.", "default": [], "x-example": null, "items": { diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index e5056d0abc..0acd0881ae 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -117,13 +117,19 @@ class Mapper $list = false; foreach ($route->getParams() as $name => $parameter) { - $methodParameters = $method->getParameters(); + $sdkParameters = $method->getParameters(); - if (!empty($methodParameters)) { - if (!array_key_exists($name, $methodParameters)) { + if (!empty($sdkParameters)) { + $sdkMethodParameters = []; + foreach($sdkParameters as $sdkParameter) { + $sdkMethodParameters[$sdkParameter->getName()] = $sdkParameter; + } + + if (!\array_key_exists($name, $sdkMethodParameters)) { continue; } - $optional = $methodParameters[$name]['optional']; + + $optional = $sdkMethodParameters[$name]->getOptional(); } else { $optional = $parameter['optional']; } diff --git a/src/Appwrite/SDK/Parameter.php b/src/Appwrite/SDK/Parameter.php index cf46e2475a..57d061925e 100644 --- a/src/Appwrite/SDK/Parameter.php +++ b/src/Appwrite/SDK/Parameter.php @@ -62,7 +62,7 @@ class Parameter $this->validator = $validator; } - public function isOptional(): bool + public function getOptional(): bool { return $this->optional; } diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 68db229c44..36c1e74c85 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -184,7 +184,7 @@ class OpenAPI3 extends Format foreach ($method->getParameters() as $parameter) { $additionalMethod['parameters'][] = $parameter->getName(); - if (!$parameter->isOptional()) { + if (!$parameter->getOptional()) { $additionalMethod['required'][] = $parameter->getName(); } } diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 2d55cf6d33..e5b7906b3f 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -190,7 +190,7 @@ class Swagger2 extends Format foreach ($method->getParameters() as $parameter) { $additionalMethod['parameters'][] = $parameter->getName(); - if (!$parameter->isOptional()) { + if (!$parameter->getOptional()) { $additionalMethod['required'][] = $parameter->getName(); } } From 4da44cf13ca9ee428aa3e4aaa84aca3b7d1d2fd9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 5 May 2025 23:36:36 +1200 Subject: [PATCH 132/161] Lint --- src/Appwrite/GraphQL/Types/Mapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 0acd0881ae..3c7915bc96 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -121,7 +121,7 @@ class Mapper if (!empty($sdkParameters)) { $sdkMethodParameters = []; - foreach($sdkParameters as $sdkParameter) { + foreach ($sdkParameters as $sdkParameter) { $sdkMethodParameters[$sdkParameter->getName()] = $sdkParameter; } From 4b1dba692c5377ddb0bd50442e54d8323f914dba Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 01:02:07 +1200 Subject: [PATCH 133/161] Min 1 operation --- app/controllers/api/databases.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 12fd25cd7c..a6e0d0c804 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3342,7 +3342,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $document->setAttribute('$permissions', $permissions); }; - $operations = 0; + $operations = 1; $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database, &$operations) { $operations++; @@ -3507,7 +3507,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); // per collection $response @@ -3612,7 +3612,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); } - $operations = 0; + $operations = 1; // Add $collectionId and $databaseId for all documents $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { @@ -3674,7 +3674,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); $response->addHeader('X-Debug-Operations', $operations); @@ -3767,7 +3767,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DOCUMENT_NOT_FOUND); } - $operations = 0; + $operations = 1; // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -3816,7 +3816,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $processDocument($collection, $document); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); $response->addHeader('X-Debug-Operations', $operations); @@ -4042,7 +4042,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $data['$permissions'] = $permissions; $newDocument = new Document($data); - $operations = 0; + $operations = 1; $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database, &$operations) { @@ -4116,7 +4116,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $setCollection($collection, $newDocument); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $response->addHeader('X-Debug-Operations', $operations); @@ -4309,7 +4309,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 0; + $operations = 1; $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { $operations++; @@ -4350,7 +4350,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $response @@ -4427,7 +4427,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $operations = 0; + $operations = 1; // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -4467,7 +4467,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $processDocument($collection, $document); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $relationships = \array_map( @@ -4561,7 +4561,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 0; + $operations = 1; $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { @@ -4612,7 +4612,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') }); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1)) + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $response From 9b6408e53afe6551eda3019e8b1bf2cfa1dfc1c7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 01:47:35 +1200 Subject: [PATCH 134/161] Fluent setter for parameter --- src/Appwrite/SDK/Parameter.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/SDK/Parameter.php b/src/Appwrite/SDK/Parameter.php index 57d061925e..ca67582589 100644 --- a/src/Appwrite/SDK/Parameter.php +++ b/src/Appwrite/SDK/Parameter.php @@ -27,9 +27,10 @@ class Parameter return $this->name; } - public function setName(string $name): void + public function setName(string $name): static { $this->name = $name; + return $this; } public function getDescription(): string @@ -37,9 +38,10 @@ class Parameter return $this->description; } - public function setDescription(string $description): void + public function setDescription(string $description): static { $this->description = $description; + return $this; } public function getDefault(): mixed @@ -47,9 +49,10 @@ class Parameter return $this->default; } - public function setDefault(mixed $default): void + public function setDefault(mixed $default): static { $this->default = $default; + return $this; } public function getValidator(): mixed @@ -57,9 +60,10 @@ class Parameter return $this->validator; } - public function setValidator(mixed $validator): void + public function setValidator(mixed $validator): static { $this->validator = $validator; + return $this; } public function getOptional(): bool @@ -67,8 +71,9 @@ class Parameter return $this->optional; } - public function setOptional(bool $optional): void + public function setOptional(bool $optional): static { $this->optional = $optional; + return $this; } } From 66a40eb175846fb70d05fe3c00b6a3405462581d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 02:21:45 +1200 Subject: [PATCH 135/161] AI review fixes --- app/controllers/api/databases.php | 4 ++++ tests/e2e/Services/Databases/DatabasesCustomClientTest.php | 2 +- tests/e2e/Services/Realtime/RealtimeCustomClientTest.php | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index a6e0d0c804..1e92039214 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4611,6 +4611,10 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') return true; }); + foreach ($documents as $document) { + $processDocument($collection, $document); + } + $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index e60e79a778..9f75e5f25c 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -1285,7 +1285,7 @@ class DatabasesCustomClientTest extends Scope ], ]); - $this->assertEquals(201, $collection1['headers']['status-code']); + $this->assertEquals(201, $collection2['headers']['status-code']); $collection1 = $collection1['body']['$id']; $collection2 = $collection2['body']['$id']; diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index e251689475..9e3f1a66b7 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -674,7 +674,6 @@ class RealtimeCustomClientTest extends Scope $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; - $documentIds = []; $client = $this->getWebsocket(['documents', 'collections'], [ 'origin' => 'http://localhost', @@ -764,8 +763,6 @@ class RealtimeCustomClientTest extends Scope $response = json_decode($client->receive(), true); $documentId = $document['body']['$id']; - $documentIds[] = $documentId; - $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); $this->assertEquals('event', $response['type']); From cc4c147b15518dceb7d3a384a71fa1ff4ce11b75 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 13:36:45 +1200 Subject: [PATCH 136/161] First class callable syntax --- src/Appwrite/Platform/Tasks/Specs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 389e8b523f..76c9db079a 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -49,7 +49,7 @@ class Specs extends Action ->desc('Generate Appwrite API specifications') ->param('version', 'latest', new Text(16), 'Spec version', true) ->param('mode', 'normal', new WhiteList(['normal', 'mocks']), 'Spec Mode', true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $version, string $mode): void From af51e3119760cc256a5fcde1560abc24c7945b99 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 13:45:18 +1200 Subject: [PATCH 137/161] Remove debug headers --- app/controllers/api/databases.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 1e92039214..81163de7dc 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3510,9 +3510,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); // per collection - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->addHeader('X-Debug-Operations', $operations); + $response->setStatusCode(Response::STATUS_CODE_CREATED); if ($isBulk) { $response->dynamic(new Document([ @@ -3677,8 +3675,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); - $response->addHeader('X-Debug-Operations', $operations); - $select = \array_reduce($queries, function ($result, $query) { return $result || ($query->getMethod() === Query::TYPE_SELECT); }, false); @@ -3819,8 +3815,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); - $response->addHeader('X-Debug-Operations', $operations); - $response->dynamic($document, Response::MODEL_DOCUMENT); }); @@ -4119,8 +4113,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); - $response->addHeader('X-Debug-Operations', $operations); - try { $document = $dbForProject->updateDocument( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), @@ -4354,7 +4346,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $response - ->addHeader('X-Debug-Operations', $operations) ->dynamic(new Document([ 'total' => \count($documents), 'documents' => $documents @@ -4620,7 +4611,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); $response - ->addHeader('X-Debug-Operations', $operations) ->dynamic(new Document([ 'total' => \count($documents), 'documents' => $documents, From a6d23298ac924322f965e292635356b5cecf3154 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 13:50:38 +1200 Subject: [PATCH 138/161] Use constant --- app/http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/http.php b/app/http.php index 4fc6ea6825..963f550b8b 100644 --- a/app/http.php +++ b/app/http.php @@ -496,7 +496,7 @@ $http->on(Constant::EVENT_REQUEST, function (SwooleRequest $swooleRequest, Swool }); // Fetch domains every `DOMAIN_SYNC_TIMER` seconds and update in the memory -$http->on('Task', function () use ($register, $domains) { +$http->on(Constant::EVENT_TASK, function () use ($register, $domains) { $lastSyncUpdate = null; $pools = $register->get('pools'); App::setResource('pools', fn () => $pools); From af09f17e02c29aafd9f2f58e5a9acee5f6b35a19 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 6 May 2025 22:05:59 +1200 Subject: [PATCH 139/161] Max 1 operation --- app/controllers/api/databases.php | 42 +++++++++---------- composer.lock | 30 ++++++------- .../e2e/Services/Databases/DatabasesBase.php | 1 + 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 81163de7dc..257622fe2e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3342,7 +3342,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $document->setAttribute('$permissions', $permissions); }; - $operations = 1; + $operations = 0; $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database, &$operations) { $operations++; @@ -3507,8 +3507,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); // per collection + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); // per collection $response->setStatusCode(Response::STATUS_CODE_CREATED); @@ -3610,7 +3610,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); } - $operations = 1; + $operations = 0; // Add $collectionId and $databaseId for all documents $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { @@ -3672,8 +3672,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); $select = \array_reduce($queries, function ($result, $query) { return $result || ($query->getMethod() === Query::TYPE_SELECT); @@ -3763,7 +3763,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DOCUMENT_NOT_FOUND); } - $operations = 1; + $operations = 0; // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -3812,8 +3812,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $processDocument($collection, $document); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); $response->dynamic($document, Response::MODEL_DOCUMENT); }); @@ -4036,7 +4036,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $data['$permissions'] = $permissions; $newDocument = new Document($data); - $operations = 1; + $operations = 0; $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database, &$operations) { @@ -4110,8 +4110,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $setCollection($collection, $newDocument); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); try { $document = $dbForProject->updateDocument( @@ -4301,7 +4301,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 1; + $operations = 0; $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { $operations++; @@ -4342,8 +4342,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); $response ->dynamic(new Document([ @@ -4418,7 +4418,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $operations = 1; + $operations = 0; // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -4458,8 +4458,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $processDocument($collection, $document); $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); $relationships = \array_map( fn ($document) => $document->getAttribute('key'), @@ -4552,7 +4552,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 1; + $operations = 0; $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { @@ -4607,8 +4607,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); $response ->dynamic(new Document([ diff --git a/composer.lock b/composer.lock index 824b2f2f72..e69790c8cc 100644 --- a/composer.lock +++ b/composer.lock @@ -1179,16 +1179,16 @@ }, { "name": "open-telemetry/context", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/context.git", - "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3" + "reference": "5f553042b951d3fedf47925852c380159dfca801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/0cba875ea1953435f78aec7f1d75afa87bdbf7f3", - "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/5f553042b951d3fedf47925852c380159dfca801", + "reference": "5f553042b951d3fedf47925852c380159dfca801", "shasum": "" }, "require": { @@ -1234,7 +1234,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-08-21T00:29:20+00:00" + "time": "2025-05-02T01:57:57+00:00" }, { "name": "open-telemetry/exporter-otlp", @@ -1365,16 +1365,16 @@ }, { "name": "open-telemetry/sdk", - "version": "1.2.4", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "47fcb66ae5328c5a799195247b1dce551d85873e" + "reference": "05d9ceb6773b5bddcf485af6d4a6f543bbeb980b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/47fcb66ae5328c5a799195247b1dce551d85873e", - "reference": "47fcb66ae5328c5a799195247b1dce551d85873e", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/05d9ceb6773b5bddcf485af6d4a6f543bbeb980b", + "reference": "05d9ceb6773b5bddcf485af6d4a6f543bbeb980b", "shasum": "" }, "require": { @@ -1451,20 +1451,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-04-15T07:02:07+00:00" + "time": "2025-05-01T23:20:43+00:00" }, { "name": "open-telemetry/sem-conv", - "version": "1.30.0", + "version": "1.32.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sem-conv.git", - "reference": "4178c9f390da8e4dbca9b181a9d1efd50cf7ee0a" + "reference": "16585cc0dbc3032a318e274043454679430d2ebf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/4178c9f390da8e4dbca9b181a9d1efd50cf7ee0a", - "reference": "4178c9f390da8e4dbca9b181a9d1efd50cf7ee0a", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/16585cc0dbc3032a318e274043454679430d2ebf", + "reference": "16585cc0dbc3032a318e274043454679430d2ebf", "shasum": "" }, "require": { @@ -1508,7 +1508,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-02-06T00:21:48+00:00" + "time": "2025-05-05T03:58:53+00:00" }, { "name": "paragonie/constant_time_encoding", diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 02c0c835e5..29922680ca 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5287,6 +5287,7 @@ trait DatabasesBase ], $document['$permissions']); $this->assertEquals($collection['body']['$id'], $document['$collectionId']); $this->assertEquals($data['databaseId'], $document['$databaseId']); + $this->assertEquals($document['number'], 100); } // TEST: Check permissions persist From 8c1b9044b37a76cad5118fb79f2972bcc61bd401 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 03:10:13 +1200 Subject: [PATCH 140/161] Don't accumulate docs on update/delete --- app/controllers/api/databases.php | 56 +++++++------------ app/controllers/shared/api.php | 18 +++--- src/Appwrite/Utopia/Response.php | 1 + .../Utopia/Response/Model/BulkOperation.php | 40 +++++++++++++ 4 files changed, 72 insertions(+), 43 deletions(-) create mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 257622fe2e..e65a317dd0 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4202,7 +4202,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, + model: Response::MODEL_BULK_OPERATION, ) ], contentType: ContentType::JSON @@ -4290,17 +4290,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $partialDocument = new Document($data); - $documents = []; - - $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $partialDocument, - $queries, - onNext: function (Document $document) use (&$documents) { - $documents[] = $document; - }, - ); - $operations = 0; $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -4337,9 +4326,14 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } }; - foreach ($documents as $document) { - $processDocument($collection, $document); - } + $modified = $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $partialDocument, + $queries, + onNext: function (Document $document) use (&$processDocument) { + $processDocument($document); + }, + ); $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) @@ -4347,9 +4341,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'total' => \count($documents), - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); + 'modified' => $modified + ]), Response::MODEL_BULK_OPERATION); }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') @@ -4499,7 +4492,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, - model: Response::MODEL_DOCUMENT_LIST, + model: Response::MODEL_BULK_OPERATION, ) ], contentType: ContentType::JSON @@ -4542,16 +4535,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $documents = []; - - $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries, - onNext: function (Document $document) use (&$documents) { - $documents[] = $document; - }, - ); - $operations = 0; $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { @@ -4602,9 +4585,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') return true; }); - foreach ($documents as $document) { - $processDocument($collection, $document); - } + $modified = $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries, + onNext: function (Document $document) use (&$processDocument) { + $processDocument($document); + }, + ); $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) @@ -4612,9 +4599,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'total' => \count($documents), - 'documents' => $documents, - ]), Response::MODEL_DOCUMENT_LIST); + 'modified' => $modified, + ]), Response::MODEL_BULK_OPERATION); }); App::get('/v1/databases/usage') diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 6cd565221f..a4e96df414 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -93,14 +93,16 @@ $eventDatabaseListener = function (Document $project, Document $document, Respon $usageDatabaseListener = function (string $event, Document $document, StatsUsage $queueForStatsUsage) { $value = 1; - if ($event === Database::EVENT_DOCUMENT_DELETE) { - $value = -1; - } - - if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * $document->getAttribute('modified', 0); - } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = $document->getAttribute('modified', 0); + switch ($event) { + case Database::EVENT_DOCUMENTS_CREATE: + $value = $document->getAttribute('modified', 0); + break; + case Database::EVENT_DOCUMENT_DELETE: + $value = -1; + break; + case Database::EVENT_DOCUMENTS_DELETE: + $value = -1 * $document->getAttribute('modified', 0); + break; } switch (true) { diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 1498f51bf6..4832ec183b 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -153,6 +153,7 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; + public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php new file mode 100644 index 0000000000..3ff83b53f6 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/BulkOperation.php @@ -0,0 +1,40 @@ +addRule('modified', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'How many document were modified in this request.', + 'default' => 0, + 'example' => 10, + ]); + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'BulkOperation'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_BULK_OPERATION; + } +} From f5d243e229e14c9255ec22de933a4d4c4c6efe9a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 15:14:05 +1200 Subject: [PATCH 141/161] Fix tests for model changes --- app/controllers/api/databases.php | 10 +++--- src/Appwrite/Utopia/Response.php | 2 ++ .../e2e/Services/Databases/DatabasesBase.php | 32 +++++++++---------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e65a317dd0..96c47487ea 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4330,8 +4330,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, $queries, - onNext: function (Document $document) use (&$processDocument) { - $processDocument($document); + onNext: function (Document $document) use ($collection, &$processDocument) { + $processDocument($collection, $document); }, ); @@ -4537,7 +4537,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $operations = 0; - $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { + $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { return false; } @@ -4588,8 +4588,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $modified = $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, - onNext: function (Document $document) use (&$processDocument) { - $processDocument($document); + onNext: function (Document $document) use ($collection, &$processDocument) { + $processDocument($collection, $document); }, ); diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 4832ec183b..44d73cc187 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -32,6 +32,7 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; +use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -407,6 +408,7 @@ class Response extends SwooleResponse ->setModel(new AttributeURL()) ->setModel(new AttributeDatetime()) ->setModel(new AttributeRelationship()) + ->setModel(new BulkOperation()) ->setModel(new Index()) ->setModel(new ModelDocument()) ->setModel(new Log()) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 29922680ca..c135e20b7a 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5267,7 +5267,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); + $this->assertEquals(10, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5301,7 +5301,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); + $this->assertEquals(10, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5335,7 +5335,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); + $this->assertEquals(5, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5361,7 +5361,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); + $this->assertEquals(5, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5387,7 +5387,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); + $this->assertEquals(10, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5491,7 +5491,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(11, $response['body']['total']); + $this->assertEquals(11, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5522,7 +5522,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); + $this->assertEquals(5, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5543,7 +5543,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); + $this->assertEquals(6, $response['body']['modified']); // SUCCESS: Delete documents with query $createBulkDocuments(); @@ -5566,7 +5566,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); + $this->assertEquals(5, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5583,7 +5583,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); + $this->assertEquals(6, $response['body']['modified']); // SUCCESS: Delete Documents with limit query $createBulkDocuments(); @@ -5606,7 +5606,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['total']); + $this->assertEquals(2, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5623,7 +5623,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(9, $response['body']['total']); + $this->assertEquals(9, $response['body']['modified']); // SUCCESS: Delete Documents with offset query $createBulkDocuments(); @@ -5646,7 +5646,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); + $this->assertEquals(6, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5668,7 +5668,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); + $this->assertEquals(5, $response['body']['modified']); // SUCCESS: Delete 100 documents $createBulkDocuments(100); @@ -5687,7 +5687,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(100, $response['body']['total']); + $this->assertEquals(100, $response['body']['modified']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5698,7 +5698,7 @@ trait DatabasesBase $this->assertEquals(0, $documents['body']['total']); // Delete Database - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ + $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); From 572c49cc90f72a3fe0b27732dbd470fd079140aa Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 15:44:58 +1200 Subject: [PATCH 142/161] Revert "Don't accumulate docs on update/delete" This reverts commit 8c1b9044b37a76cad5118fb79f2972bcc61bd401. # Conflicts: # app/controllers/api/databases.php --- app/controllers/api/databases.php | 56 ++++++++++++------- app/controllers/shared/api.php | 18 +++--- src/Appwrite/Utopia/Response.php | 1 - .../Utopia/Response/Model/BulkOperation.php | 40 ------------- 4 files changed, 43 insertions(+), 72 deletions(-) delete mode 100644 src/Appwrite/Utopia/Response/Model/BulkOperation.php diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 96c47487ea..24c6eea415 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4202,7 +4202,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, - model: Response::MODEL_BULK_OPERATION, + model: Response::MODEL_DOCUMENT_LIST, ) ], contentType: ContentType::JSON @@ -4290,6 +4290,17 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $partialDocument = new Document($data); + $documents = []; + + $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $partialDocument, + $queries, + onNext: function (Document $document) use (&$documents) { + $documents[] = $document; + }, + ); + $operations = 0; $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { @@ -4326,14 +4337,9 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') } }; - $modified = $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $partialDocument, - $queries, - onNext: function (Document $document) use ($collection, &$processDocument) { - $processDocument($collection, $document); - }, - ); + foreach ($documents as $document) { + $processDocument($collection, $document); + } $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) @@ -4341,8 +4347,9 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'modified' => $modified - ]), Response::MODEL_BULK_OPERATION); + 'total' => \count($documents), + 'documents' => $documents + ]), Response::MODEL_DOCUMENT_LIST); }); App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') @@ -4492,7 +4499,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, - model: Response::MODEL_BULK_OPERATION, + model: Response::MODEL_DOCUMENT_LIST, ) ], contentType: ContentType::JSON @@ -4535,6 +4542,16 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } + $documents = []; + + $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries, + onNext: function (Document $document) use (&$documents) { + $documents[] = $document; + }, + ); + $operations = 0; $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { @@ -4585,13 +4602,9 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') return true; }); - $modified = $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries, - onNext: function (Document $document) use ($collection, &$processDocument) { - $processDocument($collection, $document); - }, - ); + foreach ($documents as $document) { + $processDocument($collection, $document); + } $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) @@ -4599,8 +4612,9 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'modified' => $modified, - ]), Response::MODEL_BULK_OPERATION); + 'total' => \count($documents), + 'documents' => $documents, + ]), Response::MODEL_DOCUMENT_LIST); }); App::get('/v1/databases/usage') diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index a4e96df414..6cd565221f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -93,16 +93,14 @@ $eventDatabaseListener = function (Document $project, Document $document, Respon $usageDatabaseListener = function (string $event, Document $document, StatsUsage $queueForStatsUsage) { $value = 1; - switch ($event) { - case Database::EVENT_DOCUMENTS_CREATE: - $value = $document->getAttribute('modified', 0); - break; - case Database::EVENT_DOCUMENT_DELETE: - $value = -1; - break; - case Database::EVENT_DOCUMENTS_DELETE: - $value = -1 * $document->getAttribute('modified', 0); - break; + if ($event === Database::EVENT_DOCUMENT_DELETE) { + $value = -1; + } + + if ($event === Database::EVENT_DOCUMENTS_DELETE) { + $value = -1 * $document->getAttribute('modified', 0); + } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { + $value = $document->getAttribute('modified', 0); } switch (true) { diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 44d73cc187..55dc56e4f4 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -154,7 +154,6 @@ class Response extends SwooleResponse public const MODEL_INDEX_LIST = 'indexList'; public const MODEL_DOCUMENT = 'document'; public const MODEL_DOCUMENT_LIST = 'documentList'; - public const MODEL_BULK_OPERATION = 'bulkOperation'; // Database Attributes public const MODEL_ATTRIBUTE = 'attribute'; diff --git a/src/Appwrite/Utopia/Response/Model/BulkOperation.php b/src/Appwrite/Utopia/Response/Model/BulkOperation.php deleted file mode 100644 index 3ff83b53f6..0000000000 --- a/src/Appwrite/Utopia/Response/Model/BulkOperation.php +++ /dev/null @@ -1,40 +0,0 @@ -addRule('modified', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'How many document were modified in this request.', - 'default' => 0, - 'example' => 10, - ]); - } - - /** - * Get Name - * - * @return string - */ - public function getName(): string - { - return 'BulkOperation'; - } - - /** - * Get Type - * - * @return string - */ - public function getType(): string - { - return Response::MODEL_BULK_OPERATION; - } -} From 41ecccda1e80f8b5e4b630d8c4b495e1ae2e6917 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 15:45:46 +1200 Subject: [PATCH 143/161] Revert "Fix tests for model changes" This reverts commit f5d243e229e14c9255ec22de933a4d4c4c6efe9a. # Conflicts: # app/controllers/api/databases.php --- app/controllers/api/databases.php | 2 +- src/Appwrite/Utopia/Response.php | 2 -- .../e2e/Services/Databases/DatabasesBase.php | 32 +++++++++---------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 24c6eea415..257622fe2e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4554,7 +4554,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $operations = 0; - $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { + $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { return false; } diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 55dc56e4f4..1498f51bf6 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -32,7 +32,6 @@ use Appwrite\Utopia\Response\Model\BaseList; use Appwrite\Utopia\Response\Model\Branch; use Appwrite\Utopia\Response\Model\Bucket; use Appwrite\Utopia\Response\Model\Build; -use Appwrite\Utopia\Response\Model\BulkOperation; use Appwrite\Utopia\Response\Model\Collection; use Appwrite\Utopia\Response\Model\ConsoleVariables; use Appwrite\Utopia\Response\Model\Continent; @@ -407,7 +406,6 @@ class Response extends SwooleResponse ->setModel(new AttributeURL()) ->setModel(new AttributeDatetime()) ->setModel(new AttributeRelationship()) - ->setModel(new BulkOperation()) ->setModel(new Index()) ->setModel(new ModelDocument()) ->setModel(new Log()) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index c135e20b7a..29922680ca 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5267,7 +5267,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5301,7 +5301,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5335,7 +5335,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertCount(5, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5361,7 +5361,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertCount(5, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5387,7 +5387,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(10, $response['body']['modified']); + $this->assertCount(10, $response['body']['documents']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5491,7 +5491,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(11, $response['body']['modified']); + $this->assertEquals(11, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5522,7 +5522,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5543,7 +5543,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); // SUCCESS: Delete documents with query $createBulkDocuments(); @@ -5566,7 +5566,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5583,7 +5583,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); // SUCCESS: Delete Documents with limit query $createBulkDocuments(); @@ -5606,7 +5606,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['modified']); + $this->assertEquals(2, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5623,7 +5623,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(9, $response['body']['modified']); + $this->assertEquals(9, $response['body']['total']); // SUCCESS: Delete Documents with offset query $createBulkDocuments(); @@ -5646,7 +5646,7 @@ trait DatabasesBase ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['modified']); + $this->assertEquals(6, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5668,7 +5668,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['modified']); + $this->assertEquals(5, $response['body']['total']); // SUCCESS: Delete 100 documents $createBulkDocuments(100); @@ -5687,7 +5687,7 @@ trait DatabasesBase ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(100, $response['body']['modified']); + $this->assertEquals(100, $response['body']['total']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5698,7 +5698,7 @@ trait DatabasesBase $this->assertEquals(0, $documents['body']['total']); // Delete Database - $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); From 5f19398a9b9df079660cd1e896d3ccd25f9c1f9d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 15:28:53 +1200 Subject: [PATCH 144/161] Accumulate up to limit --- app/controllers/api/databases.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 257622fe2e..c9a7f5bb13 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4215,7 +4215,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { + ->inject('plan') + ->action(function (string $databaseId, string $collectionId, string|array $data, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -4296,8 +4297,10 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, $queries, - onNext: function (Document $document) use (&$documents) { - $documents[] = $document; + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH) { + $documents[] = $document; + } }, ); @@ -4511,7 +4514,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') - ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage) { + ->inject('plan') + ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -4547,8 +4551,10 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, - onNext: function (Document $document) use (&$documents) { - $documents[] = $document; + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH) { + $documents[] = $document; + } }, ); From 05821c29939d8a358352efcc843644d1b4498f51 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 15:38:32 +1200 Subject: [PATCH 145/161] Fix conditional --- app/controllers/api/databases.php | 4 ++-- tests/e2e/Services/Databases/DatabasesBase.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index c9a7f5bb13..0471c6a63a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4298,7 +4298,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $partialDocument, $queries, onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { $documents[] = $document; } }, @@ -4552,7 +4552,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { $documents[] = $document; } }, diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 29922680ca..30403b66d3 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5279,6 +5279,11 @@ trait DatabasesBase $this->assertEquals(200, $documents['headers']['status-code']); $this->assertEquals(10, $documents['body']['total']); + $returnedDocuments = $response['body']['documents']; + $refetchedDocuments = $documents['body']['documents']; + + $this->assertEquals($returnedDocuments, $refetchedDocuments); + foreach ($documents['body']['documents'] as $document) { $this->assertEquals([ Permission::read(Role::user($this->getUser()['$id'])), From fdc98389b1b9c1f9d5d34393d24fc34be75803f1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 16:22:15 +1200 Subject: [PATCH 146/161] Return total as modified count --- app/controllers/api/databases.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 0471c6a63a..6c1005238a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4293,7 +4293,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = []; - $dbForProject->updateDocuments( + $modified = $dbForProject->updateDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $partialDocument, $queries, @@ -4350,7 +4350,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'total' => \count($documents), + 'total' => $modified, 'documents' => $documents ]), Response::MODEL_DOCUMENT_LIST); }); @@ -4548,7 +4548,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = []; - $dbForProject->deleteDocuments( + $modified = $dbForProject->deleteDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, onNext: function (Document $document) use ($plan, &$documents) { @@ -4618,7 +4618,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $response ->dynamic(new Document([ - 'total' => \count($documents), + 'total' => $modified, 'documents' => $documents, ]), Response::MODEL_DOCUMENT_LIST); }); From b44682b6ffda9239ccd19eada4c0355bd2394d94 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 7 May 2025 21:23:16 +1200 Subject: [PATCH 147/161] Doc updates --- app/controllers/api/databases.php | 12 ++++++++---- docs/references/databases/create-document.md | 2 +- docs/references/databases/create-documents.md | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 docs/references/databases/create-documents.md diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6c1005238a..06755e1d24 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3180,6 +3180,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label( 'sdk', + // Using multiple methods to abstract the complexity for SDK users [ new Method( namespace: 'databases', @@ -3206,7 +3207,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') namespace: 'databases', group: 'documents', name: 'createDocuments', - description: '/docs/references/databases/create-document.md', + description: '/docs/references/databases/create-documents.md', auth: [AuthType::KEY], responses: [ new SDKResponse( @@ -3227,8 +3228,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') ->param('data', [], new JSON(), 'Document data as JSON object.', true) - ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan']) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan']) ->inject('response') ->inject('dbForProject') ->inject('user') @@ -3239,8 +3240,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ? \json_decode($data, true) : $data; - $isBulk = true; - + /** + * Determine which internal path to call, single or bulk + */ if (empty($data) && empty($documents)) { // No single or bulk documents provided throw new Exception(Exception::DOCUMENT_MISSING_DATA); @@ -3262,6 +3264,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Param "permissions" is disallowed when creating multiple documents, set "$permissions" in each document instead'); } + $isBulk = true; + if (!empty($data)) { // Single document provided, convert to single item array // But remember that it was single to respond with a single document diff --git a/docs/references/databases/create-document.md b/docs/references/databases/create-document.md index a7d31450ef..a2444d58a4 100644 --- a/docs/references/databases/create-document.md +++ b/docs/references/databases/create-document.md @@ -1 +1 @@ -Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. +Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md new file mode 100644 index 0000000000..a7d31450ef --- /dev/null +++ b/docs/references/databases/create-documents.md @@ -0,0 +1 @@ +Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. From be7ea1f7981e76e5b139d04da4241a28fd7ceb9e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 02:49:02 +1200 Subject: [PATCH 148/161] Add bulk upsert route --- app/controllers/api/databases.php | 88 +++++- composer.lock | 14 +- docs/references/databases/upsert-documents.md | 1 + .../e2e/Services/Databases/DatabasesBase.php | 270 ++++++++++-------- 4 files changed, 243 insertions(+), 130 deletions(-) create mode 100644 docs/references/databases/upsert-documents.md diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 06755e1d24..a3b3b96ce1 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3235,7 +3235,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForStatsUsage') - ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage) { + ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $permissions, ?array $documents, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage) { $data = \is_string($data) ? \json_decode($data, true) : $data; @@ -4359,6 +4359,88 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ]), Response::MODEL_DOCUMENT_LIST); }); +App::put('/v1/databases/:databaseId/collections/:collectionId/documents') + ->desc('Create or update documents') + ->groups(['api', 'database']) + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.upsert') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->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: 'databases', + group: 'documents', + name: 'upsertDocuments', + description: '/docs/references/databases/upsert-documents.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of document data as JSON objects. May contain partial documents.', true, ['plan']) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForStatsUsage') + ->inject('plan') + ->action(function (string $databaseId, string $collectionId, array $documents, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + if ($collection->isEmpty()) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + $hasRelationships = \array_filter( + $collection->getAttribute('attributes', []), + fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + ); + + if ($hasRelationships) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk upsert is not supported for collections with relationship attributes'); + } + + foreach ($documents as $key => $document) { + $documents[$key] = new Document($document); + } + + $upserted = []; + + $modified = $dbForProject->createOrUpdateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $documents, + onNext: function (Document $document) use ($plan, &$upserted) { + if (\count($upserted) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $upserted[] = $document; + } + }, + ); + + foreach ($upserted as $document) { + $document->setAttribute('$databaseId', $database->getId()); + $document->setAttribute('$collectionId', $collection->getId()); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + + $response->dynamic(new Document([ + 'total' => $modified, + 'documents' => $upserted + ]), Response::MODEL_DOCUMENT_LIST); + }); + App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) ->desc('Delete document') @@ -4912,7 +4994,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') $response->dynamic(new Document([ 'range' => $range, - 'documentsTotal' => $usage[$metrics[0]]['total'], - 'documents' => $usage[$metrics[0]]['data'], + 'documentsTotal' => $usage[$metrics[0]]['total'], + 'documents' => $usage[$metrics[0]]['data'], ]), Response::MODEL_USAGE_COLLECTION); }); diff --git a/composer.lock b/composer.lock index 560d90af8b..6e9475dc5c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "49b9828ae72763d2a398358c28cebdd5", + "content-hash": "3c140ba66f30878720ebe009abc158a7", "packages": [ { "name": "adhocore/jwt", @@ -3499,16 +3499,16 @@ }, { "name": "utopia-php/database", - "version": "0.67.2", + "version": "0.67.4", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "cd55117beab0025fd0d3f945a5a004125600982c" + "reference": "f2d687abe6a94e742b070bfce0356ab33d62cff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/cd55117beab0025fd0d3f945a5a004125600982c", - "reference": "cd55117beab0025fd0d3f945a5a004125600982c", + "url": "https://api.github.com/repos/utopia-php/database/zipball/f2d687abe6a94e742b070bfce0356ab33d62cff8", + "reference": "f2d687abe6a94e742b070bfce0356ab33d62cff8", "shasum": "" }, "require": { @@ -3549,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.67.2" + "source": "https://github.com/utopia-php/database/tree/0.67.4" }, - "time": "2025-05-06T12:11:58+00:00" + "time": "2025-05-07T14:37:07+00:00" }, { "name": "utopia-php/domains", diff --git a/docs/references/databases/upsert-documents.md b/docs/references/databases/upsert-documents.md new file mode 100644 index 0000000000..f46254bd7b --- /dev/null +++ b/docs/references/databases/upsert-documents.md @@ -0,0 +1 @@ +Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 30403b66d3..b5ddedbf90 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -5054,126 +5054,6 @@ trait DatabasesBase $this->assertEquals(400, $response['headers']['status-code']); } - public function testBulkCreateRelationships(): void - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Creates Relationships' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection1', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection2', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $collection1 = $collection1['body']['$id']; - $collection2 = $collection2['body']['$id']; - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_MANY, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_RESTRICT, - ]); - - sleep(2); - - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collection1}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'name' => 'Document 1', - 'collection2' => [ - [ - '$id' => ID::unique(), - 'name' => 'Document 2', - ], - [ - '$id' => ID::unique(), - 'name' => 'Document 3', - ], - ], - ], - [ - '$id' => ID::unique(), - 'name' => 'Document 2', - 'collection2' => [ - [ - '$id' => ID::unique(), - 'name' => 'Document 4', - ], - [ - '$id' => ID::unique(), - 'name' => 'Document 5', - ], - ], - ], - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - } - public function testBulkUpdates(): void { // Create database @@ -5405,6 +5285,156 @@ trait DatabasesBase $this->assertEquals(10, $documents['body']['total']); } + public function testBulkUpserts(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Upserts' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Upserts', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // Wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + $documents = []; + + for ($x = 1; $x <= $amount; $x++) { + $documents[] = [ + '$id' => "$x", + 'number' => $x, + ]; + } + + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + return $documents; + }; + + $documents = $createBulkDocuments(); + + // Update a document + $documents[\array_key_last($documents)]['number'] = 1000; + + // Add a new document + $documents[] = ['number' => 11]; + + // TEST: Upsert all documents + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + // Unchanged docs are skipped. 2 documents should be returned, 1 updated and 1 inserted. + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + $this->assertEquals(1000, $response['body']['documents'][0]['number']); + $this->assertEquals(11, $response['body']['documents'][1]['number']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $index => $document) { + $this->assertEquals($collection['body']['$id'], $document['$collectionId']); + $this->assertEquals($data['databaseId'], $document['$databaseId']); + switch ($index) { + case 9: + $this->assertEquals($document['number'], 1000); + break; + default: + $this->assertEquals($document['number'], $index + 1); + } + } + + // TEST: Upsert permissions: + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => '1', + 'number' => 1000, + ], + [ + '$id' => '10', + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + 'number' => 10, + ], + ], + ]); + + $this->assertEquals(1000, $response['body']['documents'][0]['number']); + $this->assertEquals([], $response['body']['documents'][0]['$permissions']); + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $response['body']['documents'][1]['$permissions']); + } + public function testBulkDeletes(): void { // Create database From 1e19e7d0b462814fe27db92e16270a908824c270 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 02:59:04 +1200 Subject: [PATCH 149/161] Remove permissions + relationships logic from bulk update/delete --- app/controllers/api/databases.php | 170 ++++-------------------------- 1 file changed, 22 insertions(+), 148 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index a3b3b96ce1..b651e33ca1 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4229,18 +4229,13 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DOCUMENT_MISSING_PAYLOAD); } - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); - - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4259,36 +4254,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $permissions = $data['$permissions'] ?? null; - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions, [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]); - - // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); - if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); - } - } - } - } - if (!\is_null($permissions)) { $data['$permissions'] = $permissions; } @@ -4308,55 +4273,19 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 0; - - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { - $operations++; - + foreach ($documents as $document) { $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $related = [$related]; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) - ); - - foreach ($related as $relation) { - if ($relation instanceof Document) { - $processDocument($relatedCollection, $relation); - } - } - } - }; - - foreach ($documents as $document) { - $processDocument($collection, $document); } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); - $response - ->dynamic(new Document([ - 'total' => $modified, - 'documents' => $documents - ]), Response::MODEL_DOCUMENT_LIST); + $response->dynamic(new Document([ + 'total' => $modified, + 'documents' => $documents + ]), Response::MODEL_DOCUMENT_LIST); }); App::put('/v1/databases/:databaseId/collections/:collectionId/documents') @@ -4602,18 +4531,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('queueForStatsUsage') ->inject('plan') ->action(function (string $databaseId, string $collectionId, array $queries, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, StatsUsage $queueForStatsUsage, array $plan) { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); - - if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + $database = $dbForProject->getDocument('databases', $databaseId); + if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); - - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { + $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4644,69 +4568,19 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') }, ); - $operations = 0; - - $processDocument = (function (Document $collection, Document &$document) use (&$processDocument, $dbForProject, $database, &$operations): bool { - if ($document->isEmpty()) { - return false; - } - - $operations++; - + foreach ($documents as $document) { $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); - - $relationships = \array_filter( - $collection->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP - ); - - foreach ($relationships as $relationship) { - $related = $document->getAttribute($relationship->getAttribute('key')); - - if (empty($related)) { - continue; - } - if (!\is_array($related)) { - $relations = [$related]; - } else { - $relations = $related; - } - - $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId)); - - foreach ($relations as $index => $doc) { - if ($doc instanceof Document) { - if (!$processDocument($relatedCollection, $doc)) { - unset($relations[$index]); - } - } - } - - if (\is_array($related)) { - $document->setAttribute($relationship->getAttribute('key'), \array_values($relations)); - } elseif (empty($relations)) { - $document->setAttribute($relationship->getAttribute('key'), null); - } - } - - return true; - }); - - foreach ($documents as $document) { - $processDocument($collection, $document); } $queueForStatsUsage - ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); - $response - ->dynamic(new Document([ - 'total' => $modified, - 'documents' => $documents, - ]), Response::MODEL_DOCUMENT_LIST); + $response->dynamic(new Document([ + 'total' => $modified, + 'documents' => $documents, + ]), Response::MODEL_DOCUMENT_LIST); }); App::get('/v1/databases/usage') From eaa105477a6589ba49a26b131cdee03ecd07b7f0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 17:17:02 +1200 Subject: [PATCH 150/161] Fix tests for permissions/relationships updates --- composer.lock | 10 +- .../e2e/Services/Databases/DatabasesBase.php | 853 --------------- .../Databases/DatabasesCustomClientTest.php | 584 ----------- .../Databases/DatabasesCustomServerTest.php | 969 ++++++++++++++++++ 4 files changed, 974 insertions(+), 1442 deletions(-) diff --git a/composer.lock b/composer.lock index 6e9475dc5c..e8cf08db6a 100644 --- a/composer.lock +++ b/composer.lock @@ -1179,16 +1179,16 @@ }, { "name": "open-telemetry/context", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/context.git", - "reference": "5f553042b951d3fedf47925852c380159dfca801" + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/5f553042b951d3fedf47925852c380159dfca801", - "reference": "5f553042b951d3fedf47925852c380159dfca801", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/1eb2b837ee9362db064a6b65d5ecce15a9f9f020", + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020", "shasum": "" }, "require": { @@ -1234,7 +1234,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-02T01:57:57+00:00" + "time": "2025-05-07T23:36:50+00:00" }, { "name": "open-telemetry/exporter-otlp", diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index b5ddedbf90..1f19c514d1 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4885,857 +4885,4 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } - - public function testBulkCreate(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Create Perms', - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Create Perms', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - sleep(1); - - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ], - [ - '$id' => ID::unique(), - 'number' => 2, - ], - [ - '$id' => ID::unique(), - 'number' => 3, - ], - ], - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertCount(3, $response['body']['documents']); - - $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(1, $response['body']['documents'][0]['number']); - $this->assertEquals(2, $response['body']['documents'][1]['number']); - $this->assertEquals(3, $response['body']['documents'][2]['number']); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(3, $response['body']['documents']); - - // TEST FAIL - Can't use data and document together - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 5 - ], - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ] - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - - // TEST FAIL - Can't use $documentId and create bulk documents - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ] - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - - // TEST FAIL - Can't miss $id in bulk documents - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - 'number' => 1, - ] - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - - // TEST FAIL - Can't miss number in bulk documents - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ], - [ - '$id' => ID::unique(), - ], - ], - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - - // TEST FAIL - Can't push more than APP_LIMIT_DATABASE_BATCH documents - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => array_fill(0, APP_LIMIT_DATABASE_BATCH + 1, [ - '$id' => ID::unique(), - 'number' => 1, - ]), - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - } - - public function testBulkUpdates(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Updates' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Updates', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - // Wait for database worker to create attributes - sleep(2); - - // Create documents - $createBulkDocuments = function ($amount = 10) use ($data) { - $documents = []; - - for ($x = 1; $x <= $amount; $x++) { - $documents[] = [ - '$id' => ID::unique(), - 'number' => $x, - ]; - } - - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => $documents, - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - }; - - $createBulkDocuments(); - - // TEST: Update all documents - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 100, - '$permissions' => [ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - Query::equal('number', [100])->toString(), - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - $returnedDocuments = $response['body']['documents']; - $refetchedDocuments = $documents['body']['documents']; - - $this->assertEquals($returnedDocuments, $refetchedDocuments); - - foreach ($documents['body']['documents'] as $document) { - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $document['$permissions']); - $this->assertEquals($collection['body']['$id'], $document['$collectionId']); - $this->assertEquals($data['databaseId'], $document['$databaseId']); - $this->assertEquals($document['number'], 100); - } - - // TEST: Check permissions persist - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 200 - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - Query::equal('number', [200])->toString(), - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - foreach ($documents['body']['documents'] as $document) { - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $document['$permissions']); - } - - // TEST: Update documents with limit - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 300 - ], - 'queries' => [ - Query::limit(5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [200])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(5, $documents['body']['total']); - - // TEST: Update documents with offset - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 300 - ], - 'queries' => [ - Query::offset(5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(5, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [300])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - - // TEST: Update documents with equals filter - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 400 - ], - 'queries' => [ - Query::equal('number', [300])->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(10, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::equal('number', [400])->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(10, $documents['body']['total']); - } - - public function testBulkUpserts(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Upserts' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Upserts', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - // Wait for database worker to create attributes - sleep(2); - - // Create documents - $createBulkDocuments = function ($amount = 10) use ($data) { - $documents = []; - - for ($x = 1; $x <= $amount; $x++) { - $documents[] = [ - '$id' => "$x", - 'number' => $x, - ]; - } - - $response = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => $documents, - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - - return $documents; - }; - - $documents = $createBulkDocuments(); - - // Update a document - $documents[\array_key_last($documents)]['number'] = 1000; - - // Add a new document - $documents[] = ['number' => 11]; - - // TEST: Upsert all documents - $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => $documents, - ]); - - // Unchanged docs are skipped. 2 documents should be returned, 1 updated and 1 inserted. - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(2, $response['body']['documents']); - $this->assertEquals(1000, $response['body']['documents'][0]['number']); - $this->assertEquals(11, $response['body']['documents'][1]['number']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ])); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - foreach ($documents['body']['documents'] as $index => $document) { - $this->assertEquals($collection['body']['$id'], $document['$collectionId']); - $this->assertEquals($data['databaseId'], $document['$databaseId']); - switch ($index) { - case 9: - $this->assertEquals($document['number'], 1000); - break; - default: - $this->assertEquals($document['number'], $index + 1); - } - } - - // TEST: Upsert permissions: - $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => '1', - 'number' => 1000, - ], - [ - '$id' => '10', - '$permissions' => [ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], - 'number' => 10, - ], - ], - ]); - - $this->assertEquals(1000, $response['body']['documents'][0]['number']); - $this->assertEquals([], $response['body']['documents'][0]['$permissions']); - $this->assertEquals([ - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ], $response['body']['documents'][1]['$permissions']); - } - - public function testBulkDeletes(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Deletes' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Deletes', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - // wait for database worker to create attributes - sleep(2); - - // Create documents - $createBulkDocuments = function ($amount = 11) use ($data) { - $documents = []; - - for ($x = 0; $x < $amount; $x++) { - $documents[] = [ - '$id' => ID::unique(), - 'number' => $x, - ]; - } - - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => $documents, - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - }; - - $createBulkDocuments(); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - // TEST: Delete all documents - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(11, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(0, $documents['body']['total']); - - // TEST: Delete documents with query - $createBulkDocuments(); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::lessThan('number', 5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(6, $documents['body']['total']); - - foreach ($documents['body']['documents'] as $document) { - $this->assertGreaterThanOrEqual(5, $document['number']); - } - - // Cleanup - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); - - // SUCCESS: Delete documents with query - $createBulkDocuments(); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::lessThan('number', 5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(6, $documents['body']['total']); - - // Cleanup - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); - - // SUCCESS: Delete Documents with limit query - $createBulkDocuments(); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::limit(2)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(9, $documents['body']['total']); - - // Cleanup - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(9, $response['body']['total']); - - // SUCCESS: Delete Documents with offset query - $createBulkDocuments(); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(11, $documents['body']['total']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::offset(5)->toString(), - ], - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(5, $documents['body']['total']); - - $lastDoc = end($documents['body']['documents']); - - $this->assertNotEmpty($lastDoc); - $this->assertEquals(4, $lastDoc['number']); - - // Cleanup - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(5, $response['body']['total']); - - // SUCCESS: Delete 100 documents - $createBulkDocuments(100); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(100, $documents['body']['total']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(100, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(0, $documents['body']['total']); - - // Delete Database - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'], array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - } } diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 9f75e5f25c..d327b669da 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -891,588 +891,4 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); } - - public function testBulkCreatePermissions(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Create' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Create', - 'documentSecurity' => false, - 'permissions' => [ - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - sleep(2); - - // TEST FAIL - Can't create document with missing collection level permissions - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ], - [ - '$id' => ID::unique(), - 'number' => 2, - ], - [ - '$id' => ID::unique(), - 'number' => 3, - ], - ], - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); - - // TEST FAIL - Can't create document with missing document level permissions - $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'name' => 'Bulk Creates Perms', - 'documentSecurity' => true - ]); - - $this->assertEquals(200, $collection['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - ], - [ - '$id' => ID::unique(), - 'number' => 2, - ], - [ - '$id' => ID::unique(), - 'number' => 3, - ], - ], - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); - - // TEST FAIL - Can't create document with permissions that aren't our own. - $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'name' => 'Bulk Creates Perms', - 'documentSecurity' => true, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ]); - - $this->assertEquals(200, $collection['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - '$permissions' => [ - Permission::create(Role::user('aaaaaa')), - Permission::read(Role::user('aaaaaa')), - Permission::update(Role::user('aaaaaa')), - Permission::delete(Role::user('aaaaaa')), - ] - ], - [ - '$id' => ID::unique(), - 'number' => 2, - '$permissions' => [ - Permission::create(Role::user('aaaaaa')), - Permission::read(Role::user('aaaaaa')), - Permission::update(Role::user('aaaaaa')), - Permission::delete(Role::user('aaaaaa')), - ] - ], - [ - '$id' => ID::unique(), - 'number' => 3, - '$permissions' => [ - Permission::create(Role::user('aaaaaa')), - Permission::read(Role::user('aaaaaa')), - Permission::update(Role::user('aaaaaa')), - Permission::delete(Role::user('aaaaaa')), - ] - ], - ], - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - - // TEST SUCCESS - Can create document with our own permissions. - $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documents' => [ - [ - '$id' => ID::unique(), - 'number' => 1, - '$permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ], - [ - '$id' => ID::unique(), - 'number' => 2, - '$permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ], - [ - '$id' => ID::unique(), - 'number' => 3, - '$permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])), - Permission::read(Role::user($this->getUser()['$id'])), - Permission::update(Role::user($this->getUser()['$id'])), - Permission::delete(Role::user($this->getUser()['$id'])), - ] - ], - ], - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertCount(3, $response['body']['documents']); - } - - // Bulk Updates - public function testBulkUpdatesPermissions(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Update Perms' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Updates Perms', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])) - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - sleep(2); - - // TEST: Update all documents with invalid collection level permissions - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 100 - ] - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - - $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'name' => 'Bulk Updates Perms', - 'documentSecurity' => true - ]); - - $this->assertEquals(200, $collection['headers']['status-code']); - - // TEST: Make sure we can update only documents we have permissions for - for ($i = 0; $i < 6; $i++) { - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'number' => $i, - ], - 'permissions' => [ - Permission::update(Role::user($this->getUser()['$id'])) - ] - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - } - - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'documentId' => ID::unique(), - 'data' => [ - 'number' => 6, - ], - 'permissions' => [ - Permission::update(Role::user('user2')), - Permission::read(Role::user($this->getUser()['$id'])), - ] - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'data' => [ - 'number' => 100 - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(6, $response['body']['documents']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'queries' => [Query::notEqual('number', 100)->toString()] - ]); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(1, $documents['body']['total']); - } - - public function testBulkUpdatesRelationship() - { - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Updates' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection1', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection1['headers']['status-code']); - - $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Collection2', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::any()), - Permission::read(Role::any()), - Permission::delete(Role::any()), - Permission::update(Role::any()), - ], - ]); - - $this->assertEquals(201, $collection2['headers']['status-code']); - - $collection1 = $collection1['body']['$id']; - $collection2 = $collection2['body']['$id']; - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/relationship', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'relatedCollectionId' => $collection2, - 'type' => Database::RELATION_ONE_TO_MANY, - 'key' => 'collection2', - 'onDelete' => Database::RELATION_MUTATE_RESTRICT, - 'twoWay' => true, - 'twoWayKey' => 'collection1', - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection2 . '/attributes/string', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'name', - 'size' => 256, - 'required' => true, - ]); - - sleep(3); - - $document1 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'name' => 'Document 1', - 'collection2' => [ - [ - 'name' => 'Document 2', - ], - ], - ], - ]); - - $this->assertEquals(201, $document1['headers']['status-code']); - $document1 = $document1['body']['$id']; - - $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collection1 . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), [ - 'data' => [ - 'name' => 'Document 1 Updated', - ] - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - } - - public function testBulkDeletesPermissions(): void - { - // Create database - $database = $this->client->call(Client::METHOD_POST, '/databases', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'databaseId' => ID::unique(), - 'name' => 'Bulk Deletes Perms' - ]); - - $this->assertNotEmpty($database['body']['$id']); - - $databaseId = $database['body']['$id']; - - $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'collectionId' => ID::unique(), - 'name' => 'Bulk Deletes Perms', - 'documentSecurity' => false, - 'permissions' => [ - Permission::create(Role::user($this->getUser()['$id'])) - ], - ]); - - $this->assertEquals(201, $collection['headers']['status-code']); - - $data = [ - '$id' => $collection['body']['$id'], - 'databaseId' => $collection['body']['databaseId'] - ]; - - // Await attribute - $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'number', - 'required' => true, - ]); - - $this->assertEquals(202, $numberAttribute['headers']['status-code']); - - sleep(2); - - // TEST: Delete all documents with invalid collection level permissions - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(401, $response['headers']['status-code']); - - $collection = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'], array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'name' => 'Bulk Deletes Perms', - 'documentSecurity' => true - ]); - - $this->assertEquals(200, $collection['headers']['status-code']); - - // TEST: Make sure we can delete only documents we have permissions for - for ($i = 0; $i < 6; $i++) { - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'documentId' => ID::unique(), - 'data' => [ - 'number' => $i, - ], - 'permissions' => [ - Permission::delete(Role::user($this->getUser()['$id'])) - ] - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - } - - $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ], [ - 'documentId' => ID::unique(), - 'data' => [ - 'number' => 6, - ], - 'permissions' => [ - Permission::delete(Role::user('user2')) - ] - ]); - - $this->assertEquals(201, $doc['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(6, $response['body']['total']); - - $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ])); - - $this->assertEquals(200, $documents['headers']['status-code']); - $this->assertEquals(1, $documents['body']['total']); - } } diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 57e0b93634..4cb0c84efd 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -4110,4 +4110,973 @@ class DatabasesCustomServerTest extends Scope $this->cleanupRelationshipCollection(); } + + public function testBulkCreate(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Create Perms', + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Create Perms', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + 'number' => 2, + ], + [ + '$id' => ID::unique(), + 'number' => 3, + ], + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + $response = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(1, $response['body']['documents'][0]['number']); + $this->assertEquals(2, $response['body']['documents'][1]['number']); + $this->assertEquals(3, $response['body']['documents'][2]['number']); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(3, $response['body']['documents']); + + // TEST FAIL - Can't use data and document together + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 5 + ], + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't use $documentId and create bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't miss $id in bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't miss number in bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + 'number' => 1, + ], + [ + '$id' => ID::unique(), + ], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't push more than APP_LIMIT_DATABASE_BATCH documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => array_fill(0, APP_LIMIT_DATABASE_BATCH + 1, [ + '$id' => ID::unique(), + 'number' => 1, + ]), + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + // TEST FAIL - Can't bulk create in a collection with relationships + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedCollectionId' => ID::unique(), + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + ['$id' => ID::unique(), 'number' => 1,], + ['$id' => ID::unique(), 'number' => 2,], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkUpdates(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Updates' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Updates', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // Wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + $documents = []; + + for ($x = 1; $x <= $amount; $x++) { + $documents[] = [ + '$id' => ID::unique(), + 'number' => $x, + ]; + } + + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + }; + + $createBulkDocuments(); + + // TEST: Update all documents + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 100, + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ] + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [100])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + $returnedDocuments = $response['body']['documents']; + $refetchedDocuments = $documents['body']['documents']; + + $this->assertEquals($returnedDocuments, $refetchedDocuments); + + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + $this->assertEquals($collection['body']['$id'], $document['$collectionId']); + $this->assertEquals($data['databaseId'], $document['$databaseId']); + $this->assertEquals($document['number'], 100); + } + + // TEST: Check permissions persist + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 200 + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + Query::equal('number', [200])->toString(), + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $document['$permissions']); + } + + // TEST: Update documents with limit + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::limit(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [200])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(5, $documents['body']['total']); + + // TEST: Update documents with offset + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 300 + ], + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(5, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [300])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + // TEST: Update documents with equals filter + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 400 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(10, $response['body']['documents']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::equal('number', [400])->toString()] + ]); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(10, $documents['body']['total']); + + // TEST: Fail - Can't bulk update in a collection with relationships + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedCollectionId' => ID::unique(), + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'number' => 500 + ], + 'queries' => [ + Query::equal('number', [300])->toString(), + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkUpserts(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Upserts' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Upserts', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // Wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 10) use ($data) { + $documents = []; + + for ($x = 1; $x <= $amount; $x++) { + $documents[] = [ + '$id' => "$x", + 'number' => $x, + ]; + } + + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + return $documents; + }; + + $documents = $createBulkDocuments(); + + // Update 1 document + $documents[\array_key_last($documents)]['number'] = 1000; + + // Add 1 document + $documents[] = ['number' => 11]; + + // TEST: Upsert all documents + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + // Unchanged docs are skipped. 2 documents should be returned, 1 updated and 1 inserted. + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(2, $response['body']['documents']); + $this->assertEquals(1000, $response['body']['documents'][0]['number']); + $this->assertEquals(11, $response['body']['documents'][1]['number']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $index => $document) { + $this->assertEquals($collection['body']['$id'], $document['$collectionId']); + $this->assertEquals($data['databaseId'], $document['$databaseId']); + switch ($index) { + case 9: + $this->assertEquals(1000, $document['number']); + break; + default: + $this->assertEquals($index + 1, $document['number']); + } + } + + // TEST: Upsert permissions + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => '1', + 'number' => 1000, + ], + [ + '$id' => '10', + '$permissions' => [ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], + 'number' => 10, + ], + ], + ]); + + $this->assertEquals(1000, $response['body']['documents'][0]['number']); + $this->assertEquals([], $response['body']['documents'][0]['$permissions']); + $this->assertEquals([ + Permission::read(Role::user($this->getUser()['$id'])), + Permission::update(Role::user($this->getUser()['$id'])), + Permission::delete(Role::user($this->getUser()['$id'])), + ], $response['body']['documents'][1]['$permissions']); + + // TEST: Fail - Can't bulk upsert in a collection with relationships + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedCollectionId' => ID::unique(), + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_PUT, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => '1', + 'number' => 1000, + ], + ], + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + } + + public function testBulkDeletes(): void + { + // Create database + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Bulk Deletes' + ]); + + $this->assertNotEmpty($database['body']['$id']); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Deletes', + 'documentSecurity' => false, + 'permissions' => [ + Permission::create(Role::any()), + Permission::read(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $data = [ + '$id' => $collection['body']['$id'], + 'databaseId' => $collection['body']['databaseId'] + ]; + + // Await attribute + $numberAttribute = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'number', + 'required' => true, + ]); + + $this->assertEquals(202, $numberAttribute['headers']['status-code']); + + // wait for database worker to create attributes + sleep(2); + + // Create documents + $createBulkDocuments = function ($amount = 11) use ($data) { + $documents = []; + + for ($x = 0; $x < $amount; $x++) { + $documents[] = [ + '$id' => ID::unique(), + 'number' => $x, + ]; + } + + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => $documents, + ]); + + $this->assertEquals(201, $doc['headers']['status-code']); + }; + + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + // TEST: Delete all documents + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(11, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(0, $documents['body']['total']); + + // TEST: Delete documents with query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(6, $documents['body']['total']); + + foreach ($documents['body']['documents'] as $document) { + $this->assertGreaterThanOrEqual(5, $document['number']); + } + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + // SUCCESS: Delete documents with query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::lessThan('number', 5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(6, $documents['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + // SUCCESS: Delete Documents with limit query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(2)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(9, $documents['body']['total']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(9, $response['body']['total']); + + // SUCCESS: Delete Documents with offset query + $createBulkDocuments(); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(11, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::offset(5)->toString(), + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(6, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(5, $documents['body']['total']); + + $lastDoc = end($documents['body']['documents']); + + $this->assertNotEmpty($lastDoc); + $this->assertEquals(4, $lastDoc['number']); + + // Cleanup + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(5, $response['body']['total']); + + // SUCCESS: Delete 100 documents + $createBulkDocuments(100); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(100, $documents['body']['total']); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(100, $response['body']['total']); + + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $documents['headers']['status-code']); + $this->assertEquals(0, $documents['body']['total']); + + // TEST: Fail - Can't bulk delete in a collection with relationships + + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], $this->getHeaders()), [ + 'relatedCollectionId' => ID::unique(), + 'type' => 'manyToOne', + 'twoWay' => true, + 'onDelete' => 'cascade', + 'key' => 'level2', + 'twoWayKey' => 'level1' + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + sleep(1); + + $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $data['databaseId'] . '/collections/' . $data['$id'] . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + } } From c3f0bec1ff1b22743b3467d76ec3b7cf438d808a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 18:09:37 +1200 Subject: [PATCH 151/161] Validate nested internals --- app/controllers/api/databases.php | 37 +++++--- .../Databases/DatabasesCustomClientTest.php | 1 - .../Databases/DatabasesCustomServerTest.php | 94 ++++++++++++++++--- 3 files changed, 105 insertions(+), 27 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b651e33ca1..32ba866115 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3265,7 +3265,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } $isBulk = true; - if (!empty($data)) { // Single document provided, convert to single item array // But remember that it was single to respond with a single document @@ -3307,8 +3306,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') Database::PERMISSION_DELETE, ]; + // If bulk, we need to validate permissions explicitly per document if ($isBulk) { $permissions = $document['$permissions'] ?? null; + if (!empty($permissions)) { + $validator = new Permissions(); + if (!$validator->isValid($permissions)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } + } } $permissions = Permission::aggregate($permissions, $allowedPermissions); @@ -3434,17 +3440,19 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $document['$collection'] = $collection->getId(); // Determine the source ID depending on whether it's a bulk operation. - $sourceId = $isBulk ? $document['$id'] : $documentId; + $sourceId = $isBulk + ? ($document['$id'] ?? ID::unique()) + : $documentId; - // For bulk operations, ensure $id is provided. - if ($isBulk && empty($sourceId)) { - throw new Exception( - Exception::DOCUMENT_INVALID_STRUCTURE, - '$id must be set in each document when creating bulk documents' - ); + // If bulk, we need to validate ID explicitly + if ($isBulk) { + $validator = new CustomId(); + if (!$validator->isValid($sourceId)) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } } - // Assign a unique id if needed, otherwise use the provided id. + // Assign a unique ID if needed, otherwise use the provided ID. $document['$id'] = $sourceId === 'unique()' ? ID::unique() : $sourceId; $document = new Document($document); $setPermissions($document, $permissions); @@ -4254,17 +4262,18 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - if (!\is_null($permissions)) { - $data['$permissions'] = $permissions; + if ($data['$permissions']) { + $validator = new Permissions(); + if (!$validator->isValid($data['$permissions'])) { + throw new Exception(Exception::GENERAL_BAD_REQUEST, $validator->getDescription()); + } } - $partialDocument = new Document($data); - $documents = []; $modified = $dbForProject->updateDocuments( 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $partialDocument, + new Document($data), $queries, onNext: function (Document $document) use ($plan, &$documents) { if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index d327b669da..a27815f4ed 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -872,7 +872,6 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - // We should be allowed to link and create a new document from collection 3 to collection 2. $response = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collection1['body']['$id'] . '/documents/' . $collection1['body']['$id'], array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 4cb0c84efd..829960b54f 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -4199,6 +4199,20 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(3, $response['body']['documents']); + // TEST SUCCESS - $id is auto-assigned if not included in bulk documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + 'number' => 1, + ] + ], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + // TEST FAIL - Can't use data and document together $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ 'content-type' => 'application/json', @@ -4233,13 +4247,14 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - // TEST FAIL - Can't miss $id in bulk documents + // TEST FAIL - Can't include invalid ID in bulk documents $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'documents' => [ [ + '$id' => '$invalid', 'number' => 1, ] ], @@ -4278,13 +4293,38 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); + // TEST FAIL - Can't include invalid permissions in nested documents + $response = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$data['$id']}/documents", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documents' => [ + [ + '$id' => ID::unique(), + '$permissions' => ['invalid'], + 'number' => 1, + ], + ], + ]); + // TEST FAIL - Can't bulk create in a collection with relationships - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Related', + 'documentSecurity' => true, + 'permissions' => [], + ]); + + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], $this->getHeaders()), [ - 'relatedCollectionId' => ID::unique(), + 'relatedCollectionId' => $collection2['body']['$id'], 'type' => 'manyToOne', 'twoWay' => true, 'onDelete' => 'cascade', @@ -4309,7 +4349,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); } - public function testBulkUpdates(): void + public function testBulkUpdate(): void { // Create database $database = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -4540,13 +4580,23 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(10, $documents['body']['total']); // TEST: Fail - Can't bulk update in a collection with relationships + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Related', + 'documentSecurity' => true, + 'permissions' => [], + ]); - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], $this->getHeaders()), [ - 'relatedCollectionId' => ID::unique(), + 'relatedCollectionId' => $collection2['body']['$id'], 'type' => 'manyToOne', 'twoWay' => true, 'onDelete' => 'cascade', @@ -4573,7 +4623,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); } - public function testBulkUpserts(): void + public function testBulkUpsert(): void { // Create database $database = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -4723,13 +4773,23 @@ class DatabasesCustomServerTest extends Scope ], $response['body']['documents'][1]['$permissions']); // TEST: Fail - Can't bulk upsert in a collection with relationships + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Related', + 'documentSecurity' => true, + 'permissions' => [], + ]); - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], $this->getHeaders()), [ - 'relatedCollectionId' => ID::unique(), + 'relatedCollectionId' => $collection2['body']['$id'], 'type' => 'manyToOne', 'twoWay' => true, 'onDelete' => 'cascade', @@ -4756,7 +4816,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); } - public function testBulkDeletes(): void + public function testBulkDelete(): void { // Create database $database = $this->client->call(Client::METHOD_POST, '/databases', [ @@ -5054,13 +5114,23 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(0, $documents['body']['total']); // TEST: Fail - Can't bulk delete in a collection with relationships + $collection2 = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'Bulk Related', + 'documentSecurity' => true, + 'permissions' => [], + ]); - $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $data['$id'] . '/attributes/relationship', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], $this->getHeaders()), [ - 'relatedCollectionId' => ID::unique(), + 'relatedCollectionId' => $collection2['body']['$id'], 'type' => 'manyToOne', 'twoWay' => true, 'onDelete' => 'cascade', From 540102ff97e50de63cf16a94bfb8d7bda8ce684b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 18:10:26 +1200 Subject: [PATCH 152/161] Explicitly catch exceptions --- app/controllers/api/databases.php | 61 +++++++++++++------ .../Databases/DatabasesCustomClientTest.php | 1 - 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 32ba866115..2ae8d73986 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -36,6 +36,7 @@ use Utopia\Database\Exception\Order as OrderException; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Exception\Restricted as RestrictedException; use Utopia\Database\Exception\Structure as StructureException; +use Utopia\Database\Exception\Timeout as TimeoutException; use Utopia\Database\Exception\Truncate as TruncateException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; @@ -3472,6 +3473,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); } catch (NotFoundException) { throw new Exception(Exception::COLLECTION_NOT_FOUND); + } catch (AuthorizationException) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } catch (TimeoutException) { + throw new Exception(Exception::DATABASE_TIMEOUT); } $queueForEvents @@ -4271,16 +4276,26 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = []; - $modified = $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - new Document($data), - $queries, - onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { - $documents[] = $document; - } - }, - ); + try { + $modified = $dbForProject->updateDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + new Document($data), + $queries, + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $documents[] = $document; + } + }, + ); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } catch (NotFoundException) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } catch (AuthorizationException) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } catch (TimeoutException) { + throw new Exception(Exception::DATABASE_TIMEOUT); + } foreach ($documents as $document) { $document->setAttribute('$databaseId', $database->getId()); @@ -4567,15 +4582,23 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = []; - $modified = $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $queries, - onNext: function (Document $document) use ($plan, &$documents) { - if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { - $documents[] = $document; - } - }, - ); + try { + $modified = $dbForProject->deleteDocuments( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $queries, + onNext: function (Document $document) use ($plan, &$documents) { + if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { + $documents[] = $document; + } + }, + ); + } catch (NotFoundException) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } catch (AuthorizationException) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } catch (TimeoutException) { + throw new Exception(Exception::DATABASE_TIMEOUT); + } foreach ($documents as $document) { $document->setAttribute('$databaseId', $database->getId()); diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index a27815f4ed..320508a114 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -10,7 +10,6 @@ use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -use Utopia\Database\Query; class DatabasesCustomClientTest extends Scope { From fea58c2bc9a4f35d8796a97755760a4415f9461f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 8 May 2025 07:49:27 +0000 Subject: [PATCH 153/161] refactor: maintenance task to run at a specific time --- .env | 1 + app/config/variables.php | 9 +++++++++ app/views/install/compose.phtml | 1 + docker-compose.yml | 1 + src/Appwrite/Platform/Tasks/Maintenance.php | 22 ++++++++++++++++++--- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 5ea2ba2852..a1f8cfafc6 100644 --- a/.env +++ b/.env @@ -83,6 +83,7 @@ _APP_EXECUTOR_HOST=http://proxy/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_DELAY= +_APP_MAINTENANCE_START_TIME= _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 diff --git a/app/config/variables.php b/app/config/variables.php index bfdceee027..297f11bd89 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -1037,6 +1037,15 @@ return [ 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_MAINTENANCE_START_TIME', + 'description' => 'The time of day (in 24-hour format) when the maintenance process should start. The default value is 00:00.', + 'introduction' => '1.6.2', + 'default' => '00:00', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_MAINTENANCE_RETENTION_CACHE', 'description' => 'The maximum duration (in seconds) upto which to retain cached files. The default value is 2592000 seconds (30 days).', diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 25c8c30742..816f88299b 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -144,6 +144,7 @@ $image = $this->getParam('image', ''); - _APP_LOGGING_CONFIG - _APP_MAINTENANCE_INTERVAL - _APP_MAINTENANCE_DELAY + - _APP_MAINTENANCE_START_TIME - _APP_MAINTENANCE_RETENTION_EXECUTION - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE diff --git a/docker-compose.yml b/docker-compose.yml index e8e51805d2..ac6530fd5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -733,6 +733,7 @@ services: - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_MAINTENANCE_RETENTION_SCHEDULES - _APP_MAINTENANCE_DELAY + - _APP_MAINTENANCE_START_TIME - _APP_DATABASE_SHARED_TABLES appwrite-task-stats-resources: diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index 2df75b22a8..83533a7698 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -35,12 +35,28 @@ class Maintenance extends Action Console::title('Maintenance V1'); Console::success(APP_NAME . ' maintenance process v1 has started'); - // # of days in seconds (1 day = 86400s) - $interval = (int) System::getEnv('_APP_MAINTENANCE_INTERVAL', '86400'); - $delay = (int) System::getEnv('_APP_MAINTENANCE_DELAY', '0'); + $interval = (int) System::getEnv('_APP_MAINTENANCE_INTERVAL', '86400'); // 1 day + $delay = (int) System::getEnv('_APP_MAINTENANCE_DELAY', '0'); // 0 seconds $usageStatsRetentionHourly = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_HOURLY', '8640000'); //100 days $cacheRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_CACHE', '2592000'); // 30 days $schedulesDeletionRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_SCHEDULES', '86400'); // 1 Day + $jobInitTime = System::getEnv('_APP_MAINTENANCE_START_TIME', '00:00'); // (hour:minutes) + + $now = new \DateTime(); + $now->setTimezone(new \DateTimeZone(date_default_timezone_get())); + $next = new \DateTime($now->format("Y-m-d $jobInitTime")); + $next->setTimezone(new \DateTimeZone(date_default_timezone_get())); + $delay = $next->getTimestamp() - $now->getTimestamp(); + + /** + * If time passed for the target day. + */ + if ($delay <= 0) { + $next->add(\DateInterval::createFromDateString('1 days')); + $delay = $next->getTimestamp() - $now->getTimestamp(); + } + + Console::info('Setting loop start time to ' . $next->format("Y-m-d H:i:s.v") . '. Delaying for ' . $delay . ' seconds.'); Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $console, $queueForDeletes, $queueForCertificates) { $time = DateTime::now(); From 9c50d60350c5d9733fd4069f9ab2c0461fd43bbb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 21:08:23 +1200 Subject: [PATCH 154/161] Handle upsert usage --- app/controllers/api/databases.php | 7 +------ app/controllers/shared/api.php | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 2ae8d73986..d988f72b15 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3273,20 +3273,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $documents = [$data]; } - $database = Authorization::skip(fn () => $dbForProject->getDocument( - 'databases', - $databaseId - )); - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND); } $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 6cd565221f..461df98128 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -93,14 +93,19 @@ $eventDatabaseListener = function (Document $project, Document $document, Respon $usageDatabaseListener = function (string $event, Document $document, StatsUsage $queueForStatsUsage) { $value = 1; - if ($event === Database::EVENT_DOCUMENT_DELETE) { - $value = -1; - } - - if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * $document->getAttribute('modified', 0); - } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = $document->getAttribute('modified', 0); + switch ($event) { + case Database::EVENT_DOCUMENT_DELETE: + $value = -1; + break; + case Database::EVENT_DOCUMENTS_DELETE: + $value = -1 * $document->getAttribute('modified', 0); + break; + case Database::EVENT_DOCUMENTS_CREATE: + $value = $document->getAttribute('modified', 0); + break; + case Database::EVENT_DOCUMENTS_UPSERT: + $value = $document->getAttribute('created', 0); + break; } switch (true) { From eb52ccfeae142434f61ee3e04c7f70e42240ec25 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 21:17:54 +1200 Subject: [PATCH 155/161] Update database --- composer.json | 2 +- composer.lock | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 2a8b059873..7c3da572c9 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.67.*", + "utopia-php/database": "dev-feat-upsert-ignore as 0.67.4", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index e8cf08db6a..510d4ef489 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c140ba66f30878720ebe009abc158a7", + "content-hash": "09924bef45c1e78d8af4a65f468e05e2", "packages": [ { "name": "adhocore/jwt", @@ -3499,16 +3499,16 @@ }, { "name": "utopia-php/database", - "version": "0.67.4", + "version": "dev-feat-upsert-ignore", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "f2d687abe6a94e742b070bfce0356ab33d62cff8" + "reference": "d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/f2d687abe6a94e742b070bfce0356ab33d62cff8", - "reference": "f2d687abe6a94e742b070bfce0356ab33d62cff8", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0", + "reference": "d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0", "shasum": "" }, "require": { @@ -3549,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.67.4" + "source": "https://github.com/utopia-php/database/tree/feat-upsert-ignore" }, - "time": "2025-05-07T14:37:07+00:00" + "time": "2025-05-08T09:04:44+00:00" }, { "name": "utopia-php/domains", @@ -5043,16 +5043,16 @@ }, { "name": "laravel/pint", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36" + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", + "url": "https://api.github.com/repos/laravel/pint/zipball/941d1927c5ca420c22710e98420287169c7bcaf7", + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7", "shasum": "" }, "require": { @@ -5064,11 +5064,11 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.75.0", - "illuminate/view": "^11.44.2", - "larastan/larastan": "^3.3.1", + "illuminate/view": "^11.44.7", + "larastan/larastan": "^3.4.0", "laravel-zero/framework": "^11.36.1", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^2.3", + "nunomaduro/termwind": "^2.3.1", "pestphp/pest": "^2.36.0" }, "bin": [ @@ -5105,7 +5105,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-04-08T22:11:45+00:00" + "time": "2025-05-08T08:38:12+00:00" }, { "name": "matthiasmullie/minify", @@ -8134,9 +8134,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-feat-upsert-ignore", + "alias": "0.67.4", + "alias_normalized": "0.67.4.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From 1a32ce60bddc9353528bfdd8a826c828ef7130f8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 21:57:20 +1200 Subject: [PATCH 156/161] Add on listener --- app/controllers/shared/api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 461df98128..4ac8f0f13a 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -527,6 +527,7 @@ App::init() ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) ->on(Database::EVENT_DOCUMENTS_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) ->on(Database::EVENT_DOCUMENTS_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) + ->on(Database::EVENT_DOCUMENTS_UPSERT, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForStatsUsage)) ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( $project, $document, From 077698a0ee63d86ce8785ca1f1d82fd235da0947 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 22:02:06 +1200 Subject: [PATCH 157/161] Update db to release --- composer.json | 2 +- composer.lock | 27 +++++++++------------------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 7c3da572c9..2a8b059873 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-feat-upsert-ignore as 0.67.4", + "utopia-php/database": "0.67.*", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 510d4ef489..5fef0d96c7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "09924bef45c1e78d8af4a65f468e05e2", + "content-hash": "3c140ba66f30878720ebe009abc158a7", "packages": [ { "name": "adhocore/jwt", @@ -3499,16 +3499,16 @@ }, { "name": "utopia-php/database", - "version": "dev-feat-upsert-ignore", + "version": "0.67.5", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0" + "reference": "74035473d999cb0675ca6bb0b4f604e9f19e5bc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0", - "reference": "d23b1fe446f2f8d8f8e1ebdc1fc89ada16caf6f0", + "url": "https://api.github.com/repos/utopia-php/database/zipball/74035473d999cb0675ca6bb0b4f604e9f19e5bc8", + "reference": "74035473d999cb0675ca6bb0b4f604e9f19e5bc8", "shasum": "" }, "require": { @@ -3549,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/feat-upsert-ignore" + "source": "https://github.com/utopia-php/database/tree/0.67.5" }, - "time": "2025-05-08T09:04:44+00:00" + "time": "2025-05-08T09:59:59+00:00" }, { "name": "utopia-php/domains", @@ -8134,18 +8134,9 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-feat-upsert-ignore", - "alias": "0.67.4", - "alias_normalized": "0.67.4.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { From ac760d9ddc2f8c804dc5acfb9ddd3f760426944d Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 22:09:12 +1200 Subject: [PATCH 158/161] Generate SDKs --- app/config/platforms.php | 20 +- app/config/specs/open-api3-1.6.x-client.json | 99 +-- app/config/specs/open-api3-1.6.x-console.json | 635 ++++++++++-------- app/config/specs/open-api3-1.6.x-server.json | 452 ++++++++----- app/config/specs/open-api3-latest-client.json | 99 +-- .../specs/open-api3-latest-console.json | 635 ++++++++++-------- app/config/specs/open-api3-latest-server.json | 452 ++++++++----- app/config/specs/swagger2-1.6.x-client.json | 101 +-- app/config/specs/swagger2-1.6.x-console.json | 634 +++++++++-------- app/config/specs/swagger2-1.6.x-server.json | 451 ++++++++----- app/config/specs/swagger2-latest-client.json | 101 +-- app/config/specs/swagger2-latest-console.json | 634 +++++++++-------- app/config/specs/swagger2-latest-server.json | 451 ++++++++----- .../examples/databases/create-documents.md | 14 + .../examples/databases/delete-documents.md | 14 + .../examples/databases/update-documents.md | 15 + .../examples/databases/upsert-documents.md | 14 + .../examples/databases/create-documents.md | 14 + .../examples/databases/delete-documents.md | 14 + .../examples/databases/update-documents.md | 15 + .../examples/databases/upsert-documents.md | 14 + .../examples/databases/create-documents.md | 16 + .../examples/databases/delete-documents.md | 16 + .../examples/databases/update-documents.md | 17 + .../examples/databases/upsert-documents.md | 16 + .../examples/databases/create-documents.md | 28 + .../examples/databases/delete-documents.md | 28 + .../examples/databases/update-documents.md | 29 + .../examples/databases/upsert-documents.md | 28 + .../examples/databases/create-documents.md | 18 + .../examples/databases/delete-documents.md | 18 + .../examples/databases/update-documents.md | 19 + .../examples/databases/upsert-documents.md | 18 + .../java/databases/create-documents.md | 25 + .../java/databases/delete-documents.md | 25 + .../java/databases/update-documents.md | 26 + .../java/databases/upsert-documents.md | 25 + .../kotlin/databases/create-documents.md | 16 + .../kotlin/databases/delete-documents.md | 16 + .../kotlin/databases/update-documents.md | 17 + .../kotlin/databases/upsert-documents.md | 16 + .../examples/databases/create-documents.md | 14 + .../examples/databases/delete-documents.md | 14 + .../examples/databases/update-documents.md | 15 + .../examples/databases/upsert-documents.md | 14 + .../examples/databases/create-documents.md | 17 + .../examples/databases/delete-documents.md | 17 + .../examples/databases/update-documents.md | 18 + .../examples/databases/upsert-documents.md | 17 + .../examples/databases/create-documents.md | 15 + .../examples/databases/delete-documents.md | 15 + .../examples/databases/update-documents.md | 16 + .../examples/databases/upsert-documents.md | 15 + .../examples/databases/create-documents.md | 12 + .../examples/databases/delete-documents.md | 10 + .../examples/databases/update-documents.md | 11 + .../examples/databases/upsert-documents.md | 10 + .../examples/databases/create-documents.md | 16 + .../examples/databases/delete-documents.md | 16 + .../examples/databases/update-documents.md | 17 + .../examples/databases/upsert-documents.md | 16 + .../examples/databases/create-documents.md | 15 + .../examples/databases/delete-documents.md | 15 + .../examples/databases/update-documents.md | 16 + .../examples/databases/upsert-documents.md | 15 + 65 files changed, 3635 insertions(+), 2016 deletions(-) create mode 100644 docs/examples/1.6.x/server-dart/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-dart/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-dart/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-dart/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-deno/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-deno/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-deno/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-deno/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-dotnet/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-dotnet/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-dotnet/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-dotnet/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-go/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-go/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-go/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-go/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-graphql/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-graphql/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-graphql/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-graphql/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/java/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/java/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/java/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/java/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/kotlin/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/kotlin/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/kotlin/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-kotlin/kotlin/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-nodejs/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-nodejs/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-nodejs/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-nodejs/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-php/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-php/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-php/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-php/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-python/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-python/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-python/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-python/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-rest/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-rest/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-rest/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-rest/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-ruby/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-ruby/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-ruby/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-ruby/examples/databases/upsert-documents.md create mode 100644 docs/examples/1.6.x/server-swift/examples/databases/create-documents.md create mode 100644 docs/examples/1.6.x/server-swift/examples/databases/delete-documents.md create mode 100644 docs/examples/1.6.x/server-swift/examples/databases/update-documents.md create mode 100644 docs/examples/1.6.x/server-swift/examples/databases/upsert-documents.md diff --git a/app/config/platforms.php b/app/config/platforms.php index 3be9e1b79b..98afd1a9b4 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -245,7 +245,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '16.0.0', + 'version' => '16.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -263,7 +263,7 @@ return [ [ 'key' => 'deno', 'name' => 'Deno', - 'version' => '14.0.0', + 'version' => '14.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-deno', 'package' => 'https://deno.land/x/appwrite', 'enabled' => true, @@ -281,7 +281,7 @@ return [ [ 'key' => 'php', 'name' => 'PHP', - 'version' => '14.0.0', + 'version' => '14.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -299,7 +299,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '10.0.0', + 'version' => '10.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -317,7 +317,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '15.0.0', + 'version' => '15.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -335,7 +335,7 @@ return [ [ 'key' => 'go', 'name' => 'Go', - 'version' => '0.5.0', + 'version' => '0.6.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-go', 'package' => 'https://github.com/appwrite/sdk-for-go', 'enabled' => true, @@ -353,7 +353,7 @@ return [ [ 'key' => 'dotnet', 'name' => '.NET', - 'version' => '0.12.0', + 'version' => '0.13.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-dotnet', 'package' => 'https://www.nuget.org/packages/Appwrite', 'enabled' => true, @@ -371,7 +371,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '15.0.0', + 'version' => '15.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -389,7 +389,7 @@ return [ [ 'key' => 'kotlin', 'name' => 'Kotlin', - 'version' => '8.0.0', + 'version' => '8.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', 'enabled' => true, @@ -411,7 +411,7 @@ return [ [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '9.0.0', + 'version' => '9.1.0-rc.1', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index 8cc9129dee..3cb424e53b 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -2646,7 +2646,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4427,7 +4430,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -4481,7 +4484,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -4553,14 +4556,6 @@ "description": "Document data as JSON object.", "x-example": "{}" }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON objects.", - "x-example": null, - "items": { - "type": "object" - } - }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4568,6 +4563,14 @@ "items": { "type": "string" } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } } } } @@ -4793,7 +4796,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -4877,7 +4880,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4963,7 +4966,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5078,7 +5081,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -5152,7 +5155,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -5204,7 +5207,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5256,7 +5259,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5308,7 +5311,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5360,7 +5363,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5412,7 +5415,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5464,7 +5467,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5516,7 +5519,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5568,7 +5571,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5620,7 +5623,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5672,7 +5675,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -5755,7 +5758,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5830,7 +5833,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -5916,7 +5919,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -6014,7 +6017,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -6086,7 +6089,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6175,7 +6178,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -6242,7 +6245,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6309,7 +6312,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6526,7 +6529,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -6600,7 +6603,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6676,7 +6679,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6761,7 +6764,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6823,7 +6826,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6897,7 +6900,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -6961,7 +6964,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7047,7 +7050,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7158,7 +7161,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7230,7 +7233,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7317,7 +7320,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7391,7 +7394,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7489,7 +7492,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7550,7 +7553,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 1b0dc1c247..ede32a8dbc 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -2655,7 +2655,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4356,7 +4359,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -4423,7 +4426,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4623,7 +4626,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7918,7 +7921,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7972,7 +7975,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -8044,6 +8047,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -8051,13 +8062,93 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -8181,7 +8272,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8465,7 +8556,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -9078,7 +9169,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -9243,7 +9334,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -9325,7 +9416,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9398,7 +9489,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9645,7 +9736,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9694,7 +9785,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9744,7 +9835,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9844,7 +9935,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -9904,7 +9995,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9976,7 +10067,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -10035,7 +10126,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10259,7 +10350,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10320,7 +10411,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10403,7 +10494,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -10499,7 +10590,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10568,7 +10659,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10630,7 +10721,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10694,7 +10785,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10779,7 +10870,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10843,7 +10934,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -10916,7 +11007,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11002,7 +11093,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11117,7 +11208,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11182,7 +11273,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11253,7 +11344,7 @@ "x-appwrite": { "method": "getFunctionUsage", "group": null, - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -11335,7 +11426,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11394,7 +11485,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11480,7 +11571,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11549,7 +11640,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11635,7 +11726,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -11706,7 +11797,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -11758,7 +11849,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11810,7 +11901,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11859,7 +11950,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11908,7 +11999,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11957,7 +12048,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12017,7 +12108,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12066,7 +12157,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12115,7 +12206,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12177,7 +12268,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12239,7 +12330,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12312,7 +12403,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12374,7 +12465,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12462,7 +12553,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12524,7 +12615,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12586,7 +12677,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12648,7 +12739,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12710,7 +12801,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12772,7 +12863,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12834,7 +12925,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12896,7 +12987,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12958,7 +13049,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13007,7 +13098,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13056,7 +13147,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13105,7 +13196,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13157,7 +13248,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13209,7 +13300,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13261,7 +13352,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13313,7 +13404,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13365,7 +13456,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13417,7 +13508,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13469,7 +13560,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13521,7 +13612,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13597,7 +13688,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13741,7 +13832,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13887,7 +13978,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14061,7 +14152,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14239,7 +14330,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14348,7 +14439,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14460,7 +14551,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14513,7 +14604,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14575,7 +14666,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14650,7 +14741,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14725,7 +14816,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14801,7 +14892,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14906,7 +14997,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15014,7 +15105,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15099,7 +15190,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15187,7 +15278,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15302,7 +15393,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15420,7 +15511,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15515,7 +15606,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15613,7 +15704,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15718,7 +15809,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15826,7 +15917,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15969,7 +16060,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16114,7 +16205,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16209,7 +16300,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16307,7 +16398,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16402,7 +16493,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16500,7 +16591,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16595,7 +16686,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16693,7 +16784,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16788,7 +16879,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16886,7 +16977,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16939,7 +17030,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17001,7 +17092,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17076,7 +17167,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17151,7 +17242,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17225,7 +17316,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17308,7 +17399,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17368,7 +17459,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17445,7 +17536,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17507,7 +17598,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17582,7 +17673,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17666,7 +17757,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17756,7 +17847,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17819,7 +17910,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17894,7 +17985,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -17968,7 +18059,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18056,7 +18147,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18149,7 +18240,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18225,7 +18316,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18297,7 +18388,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18408,7 +18499,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18541,7 +18632,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18646,7 +18737,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18770,7 +18861,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18828,7 +18919,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18879,7 +18970,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18939,7 +19030,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19027,7 +19118,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19073,7 +19164,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19146,7 +19237,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19204,7 +19295,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19279,7 +19370,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19339,7 +19430,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19411,7 +19502,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19545,7 +19636,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19603,7 +19694,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -19718,7 +19809,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -19778,7 +19869,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -19870,7 +19961,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -19949,7 +20040,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20028,7 +20119,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20107,7 +20198,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20186,7 +20277,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20277,7 +20368,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20359,7 +20450,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20438,7 +20529,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20517,7 +20608,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20596,7 +20687,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20675,7 +20766,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20775,7 +20866,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -20862,7 +20953,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -20920,7 +21011,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21013,7 +21104,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21081,7 +21172,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21175,7 +21266,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21245,7 +21336,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21383,7 +21474,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21441,7 +21532,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21560,7 +21651,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21628,7 +21719,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21723,7 +21814,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -21793,7 +21884,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -21893,7 +21984,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -21972,7 +22063,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22090,7 +22181,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22221,7 +22312,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22300,7 +22391,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22524,7 +22615,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -22788,7 +22879,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23014,7 +23105,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23235,7 +23326,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23475,7 +23566,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23698,7 +23789,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -23756,7 +23847,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -23871,7 +23962,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -23939,7 +24030,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24055,7 +24146,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24125,7 +24216,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24195,7 +24286,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24267,7 +24358,7 @@ "x-appwrite": { "method": "createRule", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24351,7 +24442,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24402,7 +24493,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24462,7 +24553,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -24522,7 +24613,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24595,7 +24686,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24722,7 +24813,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -24781,7 +24872,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -24905,7 +24996,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -24966,7 +25057,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25052,7 +25143,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -25150,7 +25241,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -25222,7 +25313,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25311,7 +25402,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25378,7 +25469,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25445,7 +25536,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25662,7 +25753,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -25736,7 +25827,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -25808,7 +25899,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -25890,7 +25981,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -25966,7 +26057,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26051,7 +26142,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26113,7 +26204,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26187,7 +26278,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26251,7 +26342,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26324,7 +26415,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26410,7 +26501,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26521,7 +26612,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26593,7 +26684,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26680,7 +26771,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26754,7 +26845,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26851,7 +26942,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -26911,7 +27002,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26992,7 +27083,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27065,7 +27156,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27153,7 +27244,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27238,7 +27329,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27323,7 +27414,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -27391,7 +27482,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -27452,7 +27543,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27537,7 +27628,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27622,7 +27713,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27737,7 +27828,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -27840,7 +27931,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27945,7 +28036,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 275, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -28017,7 +28108,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28069,7 +28160,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28130,7 +28221,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28210,7 +28301,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28292,7 +28383,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -28375,7 +28466,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28449,7 +28540,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28510,7 +28601,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28583,7 +28674,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -28659,7 +28750,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28720,7 +28811,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -28779,7 +28870,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28838,7 +28929,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -28899,7 +28990,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28979,7 +29070,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29059,7 +29150,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29139,7 +29230,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29198,7 +29289,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29278,7 +29369,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29337,7 +29428,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29389,7 +29480,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -29443,7 +29534,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29514,7 +29605,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29594,7 +29685,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -29667,7 +29758,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -29777,7 +29868,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29847,7 +29938,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29936,7 +30027,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -30008,7 +30099,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30090,7 +30181,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30170,7 +30261,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30250,7 +30341,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30319,7 +30410,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30404,7 +30495,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30474,7 +30565,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -30544,7 +30635,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30625,7 +30716,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30704,7 +30795,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -30793,7 +30884,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -30867,7 +30958,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -30918,7 +31009,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index 7d8f6bd09f..584caa2956 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -2327,7 +2327,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -7467,7 +7470,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7521,7 +7524,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -7595,6 +7598,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -7602,13 +7613,94 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -7733,7 +7825,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8022,7 +8114,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8465,7 +8557,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8539,7 +8631,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8787,7 +8879,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8837,7 +8929,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8888,7 +8980,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -8948,7 +9040,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9173,7 +9265,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9235,7 +9327,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9319,7 +9411,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -9416,7 +9508,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9486,7 +9578,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9549,7 +9641,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9614,7 +9706,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9700,7 +9792,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9765,7 +9857,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -9839,7 +9931,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -9927,7 +10019,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10044,7 +10136,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10111,7 +10203,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10183,7 +10275,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10243,7 +10335,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10330,7 +10422,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10400,7 +10492,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10487,7 +10579,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -10559,7 +10651,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -10613,7 +10705,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10667,7 +10759,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10717,7 +10809,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -10767,7 +10859,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10817,7 +10909,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -10878,7 +10970,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -10928,7 +11020,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -10978,7 +11070,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11041,7 +11133,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11104,7 +11196,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11178,7 +11270,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11241,7 +11333,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -11330,7 +11422,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11393,7 +11485,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11456,7 +11548,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11519,7 +11611,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11582,7 +11674,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11645,7 +11737,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11708,7 +11800,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -11771,7 +11863,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11834,7 +11926,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11884,7 +11976,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11934,7 +12026,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11984,7 +12076,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12038,7 +12130,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12092,7 +12184,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12146,7 +12238,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12200,7 +12292,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12346,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12308,7 +12400,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12362,7 +12454,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12416,7 +12508,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -12493,7 +12585,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12638,7 +12730,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12785,7 +12877,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12960,7 +13052,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13139,7 +13231,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13249,7 +13341,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13362,7 +13454,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13416,7 +13508,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13479,7 +13571,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13555,7 +13647,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13631,7 +13723,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13708,7 +13800,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13814,7 +13906,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -13923,7 +14015,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14009,7 +14101,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14098,7 +14190,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14214,7 +14306,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14333,7 +14425,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -14429,7 +14521,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14528,7 +14620,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14634,7 +14726,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14743,7 +14835,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14887,7 +14979,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15033,7 +15125,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15129,7 +15221,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15228,7 +15320,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15324,7 +15416,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15423,7 +15515,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15519,7 +15611,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15618,7 +15710,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15714,7 +15806,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15813,7 +15905,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15867,7 +15959,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15930,7 +16022,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16006,7 +16098,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16082,7 +16174,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16157,7 +16249,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16241,7 +16333,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16302,7 +16394,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16380,7 +16472,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16443,7 +16535,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16519,7 +16611,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16604,7 +16696,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16696,7 +16788,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16760,7 +16852,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -16837,7 +16929,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -16911,7 +17003,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17039,7 +17131,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17099,7 +17191,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17224,7 +17316,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17286,7 +17378,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17374,7 +17466,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -17474,7 +17566,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -17548,7 +17640,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17639,7 +17731,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -17708,7 +17800,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -17777,7 +17869,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -17996,7 +18088,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -18072,7 +18164,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18150,7 +18242,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18237,7 +18329,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18301,7 +18393,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18377,7 +18469,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18443,7 +18535,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18531,7 +18623,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18644,7 +18736,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18718,7 +18810,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -18807,7 +18899,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -18883,7 +18975,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -18982,7 +19074,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19044,7 +19136,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19127,7 +19219,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19201,7 +19293,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19290,7 +19382,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19376,7 +19468,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19462,7 +19554,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -19531,7 +19623,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -19593,7 +19685,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19679,7 +19771,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -19765,7 +19857,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -19881,7 +19973,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19985,7 +20077,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20091,7 +20183,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -20144,7 +20236,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20206,7 +20298,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -20287,7 +20379,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -20370,7 +20462,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -20454,7 +20546,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20529,7 +20621,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20591,7 +20683,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20665,7 +20757,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -20742,7 +20834,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -20804,7 +20896,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -20864,7 +20956,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -20924,7 +21016,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20986,7 +21078,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21067,7 +21159,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21148,7 +21240,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21229,7 +21321,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21289,7 +21381,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21370,7 +21462,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21430,7 +21522,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21483,7 +21575,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -21538,7 +21630,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21610,7 +21702,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -21691,7 +21783,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -21765,7 +21857,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -21876,7 +21968,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21947,7 +22039,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -22037,7 +22129,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -22110,7 +22202,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22193,7 +22285,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22274,7 +22366,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 8cc9129dee..3cb424e53b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -2646,7 +2646,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4427,7 +4430,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -4481,7 +4484,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -4553,14 +4556,6 @@ "description": "Document data as JSON object.", "x-example": "{}" }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON objects.", - "x-example": null, - "items": { - "type": "object" - } - }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4568,6 +4563,14 @@ "items": { "type": "string" } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } } } } @@ -4793,7 +4796,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -4877,7 +4880,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4963,7 +4966,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5078,7 +5081,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -5152,7 +5155,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -5204,7 +5207,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5256,7 +5259,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5308,7 +5311,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5360,7 +5363,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5412,7 +5415,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5464,7 +5467,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5516,7 +5519,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5568,7 +5571,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5620,7 +5623,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5672,7 +5675,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -5755,7 +5758,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5830,7 +5833,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -5916,7 +5919,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -6014,7 +6017,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -6086,7 +6089,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6175,7 +6178,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -6242,7 +6245,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6309,7 +6312,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6526,7 +6529,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -6600,7 +6603,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6676,7 +6679,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6761,7 +6764,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6823,7 +6826,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6897,7 +6900,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -6961,7 +6964,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7047,7 +7050,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7158,7 +7161,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7230,7 +7233,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7317,7 +7320,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7391,7 +7394,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7489,7 +7492,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7550,7 +7553,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 1b0dc1c247..ede32a8dbc 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -2655,7 +2655,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4356,7 +4359,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -4423,7 +4426,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4623,7 +4626,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7918,7 +7921,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7972,7 +7975,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -8044,6 +8047,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -8051,13 +8062,93 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -8181,7 +8272,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8465,7 +8556,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -9078,7 +9169,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -9243,7 +9334,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -9325,7 +9416,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9398,7 +9489,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9645,7 +9736,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9694,7 +9785,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9744,7 +9835,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9844,7 +9935,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -9904,7 +9995,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -9976,7 +10067,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -10035,7 +10126,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10259,7 +10350,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10320,7 +10411,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10403,7 +10494,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -10499,7 +10590,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10568,7 +10659,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10630,7 +10721,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10694,7 +10785,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10779,7 +10870,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10843,7 +10934,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -10916,7 +11007,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11002,7 +11093,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11117,7 +11208,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11182,7 +11273,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11253,7 +11344,7 @@ "x-appwrite": { "method": "getFunctionUsage", "group": null, - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -11335,7 +11426,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11394,7 +11485,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11480,7 +11571,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11549,7 +11640,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11635,7 +11726,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -11706,7 +11797,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -11758,7 +11849,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11810,7 +11901,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11859,7 +11950,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -11908,7 +11999,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11957,7 +12048,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12017,7 +12108,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12066,7 +12157,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12115,7 +12206,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12177,7 +12268,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12239,7 +12330,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12312,7 +12403,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12374,7 +12465,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12462,7 +12553,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12524,7 +12615,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12586,7 +12677,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12648,7 +12739,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12710,7 +12801,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12772,7 +12863,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12834,7 +12925,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12896,7 +12987,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12958,7 +13049,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13007,7 +13098,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13056,7 +13147,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13105,7 +13196,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13157,7 +13248,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13209,7 +13300,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13261,7 +13352,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13313,7 +13404,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13365,7 +13456,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13417,7 +13508,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13469,7 +13560,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13521,7 +13612,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13597,7 +13688,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13741,7 +13832,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13887,7 +13978,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14061,7 +14152,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14239,7 +14330,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14348,7 +14439,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14460,7 +14551,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14513,7 +14604,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14575,7 +14666,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14650,7 +14741,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14725,7 +14816,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14801,7 +14892,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14906,7 +14997,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15014,7 +15105,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15099,7 +15190,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15187,7 +15278,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15302,7 +15393,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15420,7 +15511,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15515,7 +15606,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15613,7 +15704,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15718,7 +15809,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15826,7 +15917,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15969,7 +16060,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16114,7 +16205,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16209,7 +16300,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16307,7 +16398,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16402,7 +16493,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16500,7 +16591,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16595,7 +16686,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16693,7 +16784,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16788,7 +16879,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16886,7 +16977,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16939,7 +17030,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17001,7 +17092,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17076,7 +17167,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17151,7 +17242,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17225,7 +17316,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17308,7 +17399,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17368,7 +17459,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17445,7 +17536,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17507,7 +17598,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17582,7 +17673,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17666,7 +17757,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17756,7 +17847,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17819,7 +17910,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17894,7 +17985,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -17968,7 +18059,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18056,7 +18147,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18149,7 +18240,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18225,7 +18316,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18297,7 +18388,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18408,7 +18499,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18541,7 +18632,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18646,7 +18737,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18770,7 +18861,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18828,7 +18919,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18879,7 +18970,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18939,7 +19030,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19027,7 +19118,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19073,7 +19164,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19146,7 +19237,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19204,7 +19295,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19279,7 +19370,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19339,7 +19430,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19411,7 +19502,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19545,7 +19636,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19603,7 +19694,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -19718,7 +19809,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -19778,7 +19869,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -19870,7 +19961,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -19949,7 +20040,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20028,7 +20119,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20107,7 +20198,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20186,7 +20277,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20277,7 +20368,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20359,7 +20450,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20438,7 +20529,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20517,7 +20608,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20596,7 +20687,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20675,7 +20766,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -20775,7 +20866,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -20862,7 +20953,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -20920,7 +21011,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21013,7 +21104,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21081,7 +21172,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21175,7 +21266,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21245,7 +21336,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21383,7 +21474,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21441,7 +21532,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21560,7 +21651,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21628,7 +21719,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21723,7 +21814,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -21793,7 +21884,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -21893,7 +21984,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -21972,7 +22063,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22090,7 +22181,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22221,7 +22312,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22300,7 +22391,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22524,7 +22615,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -22788,7 +22879,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23014,7 +23105,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23235,7 +23326,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23475,7 +23566,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23698,7 +23789,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -23756,7 +23847,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -23871,7 +23962,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -23939,7 +24030,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24055,7 +24146,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24125,7 +24216,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24195,7 +24286,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24267,7 +24358,7 @@ "x-appwrite": { "method": "createRule", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24351,7 +24442,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24402,7 +24493,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24462,7 +24553,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -24522,7 +24613,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24595,7 +24686,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24722,7 +24813,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -24781,7 +24872,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -24905,7 +24996,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -24966,7 +25057,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25052,7 +25143,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -25150,7 +25241,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -25222,7 +25313,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25311,7 +25402,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25378,7 +25469,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25445,7 +25536,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25662,7 +25753,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -25736,7 +25827,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -25808,7 +25899,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -25890,7 +25981,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -25966,7 +26057,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26051,7 +26142,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26113,7 +26204,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26187,7 +26278,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26251,7 +26342,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26324,7 +26415,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26410,7 +26501,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26521,7 +26612,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26593,7 +26684,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26680,7 +26771,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26754,7 +26845,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26851,7 +26942,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -26911,7 +27002,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26992,7 +27083,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27065,7 +27156,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27153,7 +27244,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27238,7 +27329,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27323,7 +27414,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -27391,7 +27482,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -27452,7 +27543,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27537,7 +27628,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27622,7 +27713,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27737,7 +27828,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -27840,7 +27931,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -27945,7 +28036,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 275, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -28017,7 +28108,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28069,7 +28160,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28130,7 +28221,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28210,7 +28301,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28292,7 +28383,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -28375,7 +28466,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28449,7 +28540,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28510,7 +28601,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28583,7 +28674,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -28659,7 +28750,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28720,7 +28811,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -28779,7 +28870,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -28838,7 +28929,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -28899,7 +28990,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28979,7 +29070,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29059,7 +29150,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29139,7 +29230,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29198,7 +29289,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29278,7 +29369,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29337,7 +29428,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29389,7 +29480,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -29443,7 +29534,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29514,7 +29605,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29594,7 +29685,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -29667,7 +29758,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -29777,7 +29868,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29847,7 +29938,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29936,7 +30027,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -30008,7 +30099,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30090,7 +30181,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30170,7 +30261,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30250,7 +30341,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30319,7 +30410,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30404,7 +30495,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30474,7 +30565,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -30544,7 +30635,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30625,7 +30716,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30704,7 +30795,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -30793,7 +30884,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -30867,7 +30958,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -30918,7 +31009,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 7d8f6bd09f..584caa2956 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -2327,7 +2327,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -7467,7 +7470,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7521,7 +7524,7 @@ "model": "#\/components\/schemas\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -7595,6 +7598,14 @@ "description": "Document data as JSON object.", "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -7602,13 +7613,94 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -7733,7 +7825,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8022,7 +8114,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8465,7 +8557,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8539,7 +8631,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8787,7 +8879,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8837,7 +8929,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8888,7 +8980,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -8948,7 +9040,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9173,7 +9265,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9235,7 +9327,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9319,7 +9411,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -9416,7 +9508,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9486,7 +9578,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9549,7 +9641,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9614,7 +9706,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9700,7 +9792,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9765,7 +9857,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -9839,7 +9931,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -9927,7 +10019,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10044,7 +10136,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10111,7 +10203,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10183,7 +10275,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10243,7 +10335,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10330,7 +10422,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10400,7 +10492,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10487,7 +10579,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -10559,7 +10651,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -10613,7 +10705,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10667,7 +10759,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10717,7 +10809,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -10767,7 +10859,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10817,7 +10909,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -10878,7 +10970,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -10928,7 +11020,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -10978,7 +11070,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11041,7 +11133,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11104,7 +11196,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11178,7 +11270,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11241,7 +11333,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -11330,7 +11422,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11393,7 +11485,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11456,7 +11548,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11519,7 +11611,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11582,7 +11674,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11645,7 +11737,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11708,7 +11800,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -11771,7 +11863,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11834,7 +11926,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11884,7 +11976,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11934,7 +12026,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11984,7 +12076,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12038,7 +12130,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12092,7 +12184,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12146,7 +12238,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12200,7 +12292,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12346,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12308,7 +12400,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12362,7 +12454,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12416,7 +12508,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -12493,7 +12585,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12638,7 +12730,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12785,7 +12877,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12960,7 +13052,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13139,7 +13231,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13249,7 +13341,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13362,7 +13454,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13416,7 +13508,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13479,7 +13571,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13555,7 +13647,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13631,7 +13723,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13708,7 +13800,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13814,7 +13906,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -13923,7 +14015,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14009,7 +14101,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14098,7 +14190,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14214,7 +14306,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14333,7 +14425,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -14429,7 +14521,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14528,7 +14620,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14634,7 +14726,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14743,7 +14835,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14887,7 +14979,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15033,7 +15125,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15129,7 +15221,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15228,7 +15320,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15324,7 +15416,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15423,7 +15515,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15519,7 +15611,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15618,7 +15710,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15714,7 +15806,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15813,7 +15905,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15867,7 +15959,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15930,7 +16022,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16006,7 +16098,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16082,7 +16174,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16157,7 +16249,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16241,7 +16333,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16302,7 +16394,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16380,7 +16472,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16443,7 +16535,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16519,7 +16611,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16604,7 +16696,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16696,7 +16788,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -16760,7 +16852,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -16837,7 +16929,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -16911,7 +17003,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17039,7 +17131,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17099,7 +17191,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17224,7 +17316,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17286,7 +17378,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17374,7 +17466,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -17474,7 +17566,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -17548,7 +17640,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17639,7 +17731,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -17708,7 +17800,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -17777,7 +17869,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -17996,7 +18088,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -18072,7 +18164,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18150,7 +18242,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18237,7 +18329,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18301,7 +18393,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18377,7 +18469,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18443,7 +18535,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18531,7 +18623,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18644,7 +18736,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18718,7 +18810,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -18807,7 +18899,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -18883,7 +18975,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -18982,7 +19074,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19044,7 +19136,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19127,7 +19219,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19201,7 +19293,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19290,7 +19382,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19376,7 +19468,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19462,7 +19554,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -19531,7 +19623,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -19593,7 +19685,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19679,7 +19771,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -19765,7 +19857,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -19881,7 +19973,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19985,7 +20077,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20091,7 +20183,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -20144,7 +20236,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20206,7 +20298,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -20287,7 +20379,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -20370,7 +20462,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -20454,7 +20546,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20529,7 +20621,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20591,7 +20683,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20665,7 +20757,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -20742,7 +20834,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -20804,7 +20896,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -20864,7 +20956,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -20924,7 +21016,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20986,7 +21078,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21067,7 +21159,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21148,7 +21240,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21229,7 +21321,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21289,7 +21381,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21370,7 +21462,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21430,7 +21522,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21483,7 +21575,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -21538,7 +21630,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21610,7 +21702,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -21691,7 +21783,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -21765,7 +21857,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -21876,7 +21968,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21947,7 +22039,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -22037,7 +22129,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -22110,7 +22202,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22193,7 +22285,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22274,7 +22366,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index 308895a819..e3b2663cab 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -2765,7 +2765,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4571,7 +4574,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -4621,7 +4624,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -4690,15 +4693,6 @@ "default": [], "x-example": "{}" }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON objects.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4707,6 +4701,15 @@ "items": { "type": "string" } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } } } } @@ -4924,7 +4927,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -5002,7 +5005,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5085,7 +5088,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5202,7 +5205,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -5274,7 +5277,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -5348,7 +5351,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5420,7 +5423,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5472,7 +5475,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5524,7 +5527,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5576,7 +5579,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5628,7 +5631,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5680,7 +5683,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5732,7 +5735,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5784,7 +5787,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5838,7 +5841,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -5923,7 +5926,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5994,7 +5997,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6077,7 +6080,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -6167,7 +6170,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -6237,7 +6240,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6326,7 +6329,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -6396,7 +6399,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6466,7 +6469,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6664,7 +6667,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -6734,7 +6737,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6809,7 +6812,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6899,7 +6902,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6961,7 +6964,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7036,7 +7039,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7098,7 +7101,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7181,7 +7184,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7294,7 +7297,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7364,7 +7367,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7450,7 +7453,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7522,7 +7525,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7616,7 +7619,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7677,7 +7680,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index 3c9d98b0c7..808ce06f85 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -2790,7 +2790,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4524,7 +4527,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -4592,7 +4595,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4794,7 +4797,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8053,7 +8056,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -8103,7 +8106,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -8172,6 +8175,15 @@ "default": [], "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -8180,14 +8192,90 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": [], + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -8310,7 +8398,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8582,7 +8670,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -9164,7 +9252,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -9320,7 +9408,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -9398,7 +9486,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9470,7 +9558,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9739,7 +9827,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9788,7 +9876,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9838,7 +9926,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9932,7 +10020,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -9990,7 +10078,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10060,7 +10148,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -10119,7 +10207,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10360,7 +10448,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10419,7 +10507,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10499,7 +10587,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -10589,7 +10677,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10656,7 +10744,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10718,7 +10806,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10784,7 +10872,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10866,7 +10954,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10933,7 +11021,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -11002,7 +11090,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11085,7 +11173,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11202,7 +11290,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11267,7 +11355,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11334,7 +11422,7 @@ "x-appwrite": { "method": "getFunctionUsage", "group": null, - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -11412,7 +11500,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11471,7 +11559,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11555,7 +11643,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11622,7 +11710,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11708,7 +11796,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -11777,7 +11865,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -11851,7 +11939,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11923,7 +12011,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11972,7 +12060,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12021,7 +12109,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12070,7 +12158,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12128,7 +12216,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12177,7 +12265,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12226,7 +12314,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12286,7 +12374,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12346,7 +12434,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12415,7 +12503,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12475,7 +12563,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12559,7 +12647,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12619,7 +12707,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12679,7 +12767,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12739,7 +12827,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12799,7 +12887,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12859,7 +12947,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12919,7 +13007,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12979,7 +13067,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -13039,7 +13127,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13088,7 +13176,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13137,7 +13225,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13186,7 +13274,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13238,7 +13326,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13290,7 +13378,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13342,7 +13430,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13394,7 +13482,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13446,7 +13534,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13498,7 +13586,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13550,7 +13638,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13602,7 +13690,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13677,7 +13765,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13835,7 +13923,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13990,7 +14078,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14185,7 +14273,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14379,7 +14467,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14497,7 +14585,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14611,7 +14699,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14666,7 +14754,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14726,7 +14814,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14798,7 +14886,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14870,7 +14958,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14945,7 +15033,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15060,7 +15148,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15173,7 +15261,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15264,7 +15352,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15353,7 +15441,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15480,7 +15568,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15605,7 +15693,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15708,7 +15796,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15809,7 +15897,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15924,7 +16012,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16037,7 +16125,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16196,7 +16284,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16352,7 +16440,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16455,7 +16543,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16556,7 +16644,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16659,7 +16747,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16760,7 +16848,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16863,7 +16951,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16964,7 +17052,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17067,7 +17155,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -17166,7 +17254,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -17221,7 +17309,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17281,7 +17369,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17353,7 +17441,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17425,7 +17513,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17498,7 +17586,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17586,7 +17674,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17646,7 +17734,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17725,7 +17813,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17785,7 +17873,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17857,7 +17945,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17938,7 +18026,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -18026,7 +18114,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18089,7 +18177,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -18160,7 +18248,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18233,7 +18321,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18325,7 +18413,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18413,7 +18501,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18491,7 +18579,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18562,7 +18650,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18681,7 +18769,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18801,7 +18889,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18913,7 +19001,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19024,7 +19112,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -19082,7 +19170,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19135,7 +19223,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -19193,7 +19281,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19275,7 +19363,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19323,7 +19411,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19398,7 +19486,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19456,7 +19544,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19533,7 +19621,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19591,7 +19679,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19662,7 +19750,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19809,7 +19897,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19867,7 +19955,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -19992,7 +20080,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -20052,7 +20140,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20144,7 +20232,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -20222,7 +20310,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20300,7 +20388,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20378,7 +20466,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20456,7 +20544,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20548,7 +20636,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20629,7 +20717,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20707,7 +20795,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20785,7 +20873,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20863,7 +20951,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20941,7 +21029,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21038,7 +21126,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21123,7 +21211,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21181,7 +21269,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21273,7 +21361,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21339,7 +21427,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21434,7 +21522,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21502,7 +21590,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21640,7 +21728,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21698,7 +21786,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21818,7 +21906,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21884,7 +21972,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21981,7 +22069,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22049,7 +22137,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22149,7 +22237,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -22227,7 +22315,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22356,7 +22444,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22494,7 +22582,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22570,7 +22658,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22790,7 +22878,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23053,7 +23141,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23273,7 +23361,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23490,7 +23578,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23725,7 +23813,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23942,7 +24030,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24000,7 +24088,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24118,7 +24206,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24184,7 +24272,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24305,7 +24393,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24373,7 +24461,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24439,7 +24527,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24510,7 +24598,7 @@ "x-appwrite": { "method": "createRule", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24597,7 +24685,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24650,7 +24738,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24710,7 +24798,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -24768,7 +24856,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24840,7 +24928,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24977,7 +25065,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25036,7 +25124,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -25169,7 +25257,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25228,7 +25316,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25311,7 +25399,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -25401,7 +25489,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -25471,7 +25559,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25560,7 +25648,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25630,7 +25718,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25700,7 +25788,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25898,7 +25986,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -25968,7 +26056,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26038,7 +26126,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26116,7 +26204,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -26191,7 +26279,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26281,7 +26369,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26343,7 +26431,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26418,7 +26506,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26480,7 +26568,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26550,7 +26638,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26633,7 +26721,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26746,7 +26834,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26816,7 +26904,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26902,7 +26990,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26974,7 +27062,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27067,7 +27155,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27127,7 +27215,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27205,7 +27293,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27277,7 +27365,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27372,7 +27460,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27463,7 +27551,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27552,7 +27640,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -27621,7 +27709,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -27682,7 +27770,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27773,7 +27861,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27864,7 +27952,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27990,7 +28078,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -28102,7 +28190,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28212,7 +28300,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 275, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -28282,7 +28370,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28336,7 +28424,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28397,7 +28485,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28476,7 +28564,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28558,7 +28646,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -28638,7 +28726,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28709,7 +28797,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28770,7 +28858,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28844,7 +28932,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -28916,7 +29004,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28975,7 +29063,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29034,7 +29122,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29093,7 +29181,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29154,7 +29242,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29233,7 +29321,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29312,7 +29400,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29389,7 +29477,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29448,7 +29536,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29525,7 +29613,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29584,7 +29672,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29638,7 +29726,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -29694,7 +29782,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29763,7 +29851,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29840,7 +29928,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -29912,7 +30000,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -30023,7 +30111,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -30091,7 +30179,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -30181,7 +30269,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -30251,7 +30339,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30333,7 +30421,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30412,7 +30500,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30489,7 +30577,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30556,7 +30644,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30639,7 +30727,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30705,7 +30793,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -30771,7 +30859,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30848,7 +30936,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30928,7 +31016,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -31012,7 +31100,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31083,7 +31171,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -31136,7 +31224,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index 7119a8f584..f3da5cf4f8 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -2458,7 +2458,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -7590,7 +7593,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7640,7 +7643,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -7711,6 +7714,15 @@ "default": [], "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -7719,14 +7731,91 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": [], + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -7850,7 +7939,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8127,7 +8216,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8551,7 +8640,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8624,7 +8713,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8894,7 +8983,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8944,7 +9033,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8995,7 +9084,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -9055,7 +9144,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9297,7 +9386,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9357,7 +9446,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9438,7 +9527,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -9529,7 +9618,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9597,7 +9686,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9660,7 +9749,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9727,7 +9816,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9810,7 +9899,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9878,7 +9967,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -9948,7 +10037,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10033,7 +10122,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10152,7 +10241,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10219,7 +10308,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10287,7 +10376,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10347,7 +10436,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10432,7 +10521,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10500,7 +10589,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10587,7 +10676,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -10657,7 +10746,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -10733,7 +10822,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10807,7 +10896,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10857,7 +10946,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -10907,7 +10996,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10957,7 +11046,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11016,7 +11105,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11066,7 +11155,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11116,7 +11205,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11177,7 +11266,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11238,7 +11327,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11308,7 +11397,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11369,7 +11458,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -11454,7 +11543,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11515,7 +11604,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11576,7 +11665,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11637,7 +11726,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11698,7 +11787,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11759,7 +11848,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11820,7 +11909,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -11881,7 +11970,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11942,7 +12031,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11992,7 +12081,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12042,7 +12131,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12092,7 +12181,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12146,7 +12235,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12200,7 +12289,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12343,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12308,7 +12397,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12362,7 +12451,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12416,7 +12505,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12470,7 +12559,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12524,7 +12613,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -12600,7 +12689,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12759,7 +12848,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12915,7 +13004,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13111,7 +13200,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13306,7 +13395,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13425,7 +13514,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13540,7 +13629,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13596,7 +13685,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13657,7 +13746,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13730,7 +13819,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13803,7 +13892,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13879,7 +13968,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13995,7 +14084,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -14109,7 +14198,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14201,7 +14290,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14291,7 +14380,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14419,7 +14508,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14545,7 +14634,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -14649,7 +14738,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14751,7 +14840,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14867,7 +14956,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14981,7 +15070,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15141,7 +15230,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15298,7 +15387,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15402,7 +15491,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15504,7 +15593,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15608,7 +15697,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15710,7 +15799,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15814,7 +15903,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15916,7 +16005,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16020,7 +16109,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16120,7 +16209,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16176,7 +16265,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16237,7 +16326,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16310,7 +16399,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16383,7 +16472,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16457,7 +16546,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16546,7 +16635,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16607,7 +16696,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16687,7 +16776,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16748,7 +16837,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16821,7 +16910,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16903,7 +16992,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16993,7 +17082,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17057,7 +17146,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17130,7 +17219,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17203,7 +17292,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17341,7 +17430,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17401,7 +17490,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17535,7 +17624,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17595,7 +17684,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17680,7 +17769,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -17772,7 +17861,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -17844,7 +17933,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17935,7 +18024,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -18007,7 +18096,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18079,7 +18168,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18279,7 +18368,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -18351,7 +18440,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18428,7 +18517,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18520,7 +18609,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18584,7 +18673,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18661,7 +18750,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18725,7 +18814,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18810,7 +18899,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18925,7 +19014,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18997,7 +19086,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19085,7 +19174,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19159,7 +19248,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19254,7 +19343,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19316,7 +19405,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19396,7 +19485,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19469,7 +19558,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19565,7 +19654,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19657,7 +19746,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19747,7 +19836,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -19817,7 +19906,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -19879,7 +19968,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19971,7 +20060,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20063,7 +20152,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20190,7 +20279,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -20303,7 +20392,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20414,7 +20503,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -20469,7 +20558,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20531,7 +20620,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -20611,7 +20700,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -20694,7 +20783,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -20775,7 +20864,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20847,7 +20936,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20909,7 +20998,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20984,7 +21073,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21057,7 +21146,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21117,7 +21206,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21177,7 +21266,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21237,7 +21326,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21299,7 +21388,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21379,7 +21468,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21459,7 +21548,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21537,7 +21626,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21597,7 +21686,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21675,7 +21764,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21735,7 +21824,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21790,7 +21879,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -21847,7 +21936,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21917,7 +22006,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -21995,7 +22084,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -22068,7 +22157,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -22180,7 +22269,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -22249,7 +22338,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -22340,7 +22429,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -22411,7 +22500,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22494,7 +22583,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22574,7 +22663,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 308895a819..e3b2663cab 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -2765,7 +2765,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4571,7 +4574,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -4621,7 +4624,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -4690,15 +4693,6 @@ "default": [], "x-example": "{}" }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON objects.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, "permissions": { "type": "array", "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", @@ -4707,6 +4701,15 @@ "items": { "type": "string" } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } } } } @@ -4924,7 +4927,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -5002,7 +5005,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -5085,7 +5088,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5202,7 +5205,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -5274,7 +5277,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -5348,7 +5351,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -5420,7 +5423,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5472,7 +5475,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5524,7 +5527,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5576,7 +5579,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5628,7 +5631,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5680,7 +5683,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5732,7 +5735,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5784,7 +5787,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5838,7 +5841,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -5923,7 +5926,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5994,7 +5997,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -6077,7 +6080,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -6167,7 +6170,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -6237,7 +6240,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -6326,7 +6329,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -6396,7 +6399,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -6466,7 +6469,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6664,7 +6667,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -6734,7 +6737,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6809,7 +6812,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6899,7 +6902,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6961,7 +6964,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7036,7 +7039,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7098,7 +7101,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7181,7 +7184,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7294,7 +7297,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7364,7 +7367,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7450,7 +7453,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7522,7 +7525,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7616,7 +7619,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7677,7 +7680,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 3c9d98b0c7..808ce06f85 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -2790,7 +2790,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -4524,7 +4527,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -4592,7 +4595,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -4794,7 +4797,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8053,7 +8056,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -8103,7 +8106,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -8172,6 +8175,15 @@ "default": [], "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -8180,14 +8192,90 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": [], + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -8310,7 +8398,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8582,7 +8670,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -9164,7 +9252,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -9320,7 +9408,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -9398,7 +9486,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9470,7 +9558,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9739,7 +9827,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9788,7 +9876,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -9838,7 +9926,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -9932,7 +10020,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -9990,7 +10078,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 295, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -10060,7 +10148,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -10119,7 +10207,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10360,7 +10448,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10419,7 +10507,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10499,7 +10587,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -10589,7 +10677,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -10656,7 +10744,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -10718,7 +10806,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -10784,7 +10872,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10866,7 +10954,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10933,7 +11021,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -11002,7 +11090,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11085,7 +11173,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11202,7 +11290,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11267,7 +11355,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11334,7 +11422,7 @@ "x-appwrite": { "method": "getFunctionUsage", "group": null, - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -11412,7 +11500,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11471,7 +11559,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11555,7 +11643,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11622,7 +11710,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -11708,7 +11796,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -11777,7 +11865,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -11851,7 +11939,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -11923,7 +12011,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11972,7 +12060,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12021,7 +12109,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12070,7 +12158,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12128,7 +12216,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12177,7 +12265,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12226,7 +12314,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12286,7 +12374,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12346,7 +12434,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12415,7 +12503,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12475,7 +12563,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12559,7 +12647,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12619,7 +12707,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12679,7 +12767,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12739,7 +12827,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12799,7 +12887,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12859,7 +12947,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12919,7 +13007,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12979,7 +13067,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -13039,7 +13127,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13088,7 +13176,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13137,7 +13225,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -13186,7 +13274,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13238,7 +13326,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13290,7 +13378,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13342,7 +13430,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13394,7 +13482,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13446,7 +13534,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13498,7 +13586,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13550,7 +13638,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13602,7 +13690,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13677,7 +13765,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13835,7 +13923,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13990,7 +14078,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14185,7 +14273,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14379,7 +14467,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14497,7 +14585,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14611,7 +14699,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -14666,7 +14754,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -14726,7 +14814,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14798,7 +14886,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14870,7 +14958,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14945,7 +15033,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -15060,7 +15148,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15173,7 +15261,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15264,7 +15352,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -15353,7 +15441,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15480,7 +15568,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15605,7 +15693,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15708,7 +15796,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15809,7 +15897,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15924,7 +16012,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16037,7 +16125,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16196,7 +16284,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16352,7 +16440,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16455,7 +16543,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16556,7 +16644,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16659,7 +16747,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16760,7 +16848,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16863,7 +16951,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16964,7 +17052,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17067,7 +17155,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -17166,7 +17254,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -17221,7 +17309,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17281,7 +17369,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17353,7 +17441,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17425,7 +17513,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17498,7 +17586,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17586,7 +17674,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17646,7 +17734,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17725,7 +17813,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17785,7 +17873,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17857,7 +17945,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17938,7 +18026,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -18026,7 +18114,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18089,7 +18177,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -18160,7 +18248,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18233,7 +18321,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -18325,7 +18413,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18413,7 +18501,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18491,7 +18579,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18562,7 +18650,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18681,7 +18769,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18801,7 +18889,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18913,7 +19001,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19024,7 +19112,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -19082,7 +19170,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19135,7 +19223,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -19193,7 +19281,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19275,7 +19363,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19323,7 +19411,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19398,7 +19486,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19456,7 +19544,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19533,7 +19621,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19591,7 +19679,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -19662,7 +19750,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -19809,7 +19897,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -19867,7 +19955,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, @@ -19992,7 +20080,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -20052,7 +20140,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20144,7 +20232,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -20222,7 +20310,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -20300,7 +20388,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20378,7 +20466,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -20456,7 +20544,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20548,7 +20636,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -20629,7 +20717,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20707,7 +20795,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20785,7 +20873,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20863,7 +20951,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -20941,7 +21029,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21038,7 +21126,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21123,7 +21211,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -21181,7 +21269,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -21273,7 +21361,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -21339,7 +21427,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -21434,7 +21522,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21502,7 +21590,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 160, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -21640,7 +21728,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -21698,7 +21786,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -21818,7 +21906,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -21884,7 +21972,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21981,7 +22069,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22049,7 +22137,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -22149,7 +22237,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -22227,7 +22315,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22356,7 +22444,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22494,7 +22582,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -22570,7 +22658,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22790,7 +22878,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23053,7 +23141,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23273,7 +23361,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -23490,7 +23578,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23725,7 +23813,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -23942,7 +24030,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -24000,7 +24088,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -24118,7 +24206,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -24184,7 +24272,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -24305,7 +24393,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24373,7 +24461,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24439,7 +24527,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24510,7 +24598,7 @@ "x-appwrite": { "method": "createRule", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24597,7 +24685,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -24650,7 +24738,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -24710,7 +24798,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -24768,7 +24856,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -24840,7 +24928,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -24977,7 +25065,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25036,7 +25124,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -25169,7 +25257,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25228,7 +25316,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -25311,7 +25399,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -25401,7 +25489,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -25471,7 +25559,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -25560,7 +25648,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -25630,7 +25718,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -25700,7 +25788,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -25898,7 +25986,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -25968,7 +26056,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26038,7 +26126,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26116,7 +26204,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -26191,7 +26279,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26281,7 +26369,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26343,7 +26431,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26418,7 +26506,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26480,7 +26568,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -26550,7 +26638,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -26633,7 +26721,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -26746,7 +26834,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -26816,7 +26904,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -26902,7 +26990,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -26974,7 +27062,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27067,7 +27155,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27127,7 +27215,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27205,7 +27293,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -27277,7 +27365,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -27372,7 +27460,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -27463,7 +27551,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27552,7 +27640,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -27621,7 +27709,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -27682,7 +27770,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -27773,7 +27861,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -27864,7 +27952,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -27990,7 +28078,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -28102,7 +28190,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28212,7 +28300,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 275, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -28282,7 +28370,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -28336,7 +28424,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28397,7 +28485,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -28476,7 +28564,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -28558,7 +28646,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -28638,7 +28726,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28709,7 +28797,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -28770,7 +28858,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -28844,7 +28932,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -28916,7 +29004,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -28975,7 +29063,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29034,7 +29122,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29093,7 +29181,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29154,7 +29242,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29233,7 +29321,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29312,7 +29400,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29389,7 +29477,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29448,7 +29536,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29525,7 +29613,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29584,7 +29672,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -29638,7 +29726,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -29694,7 +29782,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29763,7 +29851,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -29840,7 +29928,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -29912,7 +30000,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -30023,7 +30111,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -30091,7 +30179,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -30181,7 +30269,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -30251,7 +30339,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30333,7 +30421,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30412,7 +30500,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30489,7 +30577,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, @@ -30556,7 +30644,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, @@ -30639,7 +30727,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 282, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -30705,7 +30793,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -30771,7 +30859,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -30848,7 +30936,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -30928,7 +31016,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -31012,7 +31100,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31083,7 +31171,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -31136,7 +31224,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 7119a8f584..f3da5cf4f8 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -2458,7 +2458,10 @@ "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", "rate-limit": 10, "rate-time": 3600, - "rate-key": "url:{url},email:{param-email}", + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], "scope": "sessions.write", "platforms": [ "server", @@ -7590,7 +7593,7 @@ "tags": [ "databases" ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", "responses": { "201": { "description": "Document", @@ -7640,7 +7643,7 @@ "model": "#\/definitions\/document" } ], - "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n" + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." }, { "name": "createDocuments", @@ -7711,6 +7714,15 @@ "default": [], "x-example": "{}" }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, "documents": { "type": "array", "description": "Array of documents data as JSON objects.", @@ -7719,14 +7731,91 @@ "items": { "type": "object" } - }, - "permissions": { + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": [], + "x-example": null, "items": { - "type": "string" + "type": "object" } } } @@ -7850,7 +7939,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, @@ -8127,7 +8216,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, @@ -8551,7 +8640,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8624,7 +8713,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8894,7 +8983,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8944,7 +9033,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -8995,7 +9084,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -9055,7 +9144,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9297,7 +9386,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9357,7 +9446,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9438,7 +9527,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 300, + "weight": 301, "cookies": false, "type": "upload", "deprecated": false, @@ -9529,7 +9618,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, @@ -9597,7 +9686,7 @@ "x-appwrite": { "method": "updateDeployment", "group": "deployments", - "weight": 298, + "weight": 299, "cookies": false, "type": "", "deprecated": false, @@ -9660,7 +9749,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, @@ -9727,7 +9816,7 @@ "x-appwrite": { "method": "createBuild", "group": "deployments", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9810,7 +9899,7 @@ "x-appwrite": { "method": "updateDeploymentBuild", "group": "deployments", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9878,7 +9967,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 297, + "weight": 298, "cookies": false, "type": "location", "deprecated": false, @@ -9948,7 +10037,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10033,7 +10122,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10152,7 +10241,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10219,7 +10308,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10287,7 +10376,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10347,7 +10436,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10432,7 +10521,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10500,7 +10589,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -10587,7 +10676,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -10657,7 +10746,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 332, + "weight": 333, "cookies": false, "type": "graphql", "deprecated": false, @@ -10733,7 +10822,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 331, + "weight": 332, "cookies": false, "type": "graphql", "deprecated": false, @@ -10807,7 +10896,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10857,7 +10946,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 148, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -10907,7 +10996,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -10957,7 +11046,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11016,7 +11105,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11066,7 +11155,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11116,7 +11205,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11177,7 +11266,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11238,7 +11327,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11308,7 +11397,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11369,7 +11458,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -11454,7 +11543,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11515,7 +11604,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11576,7 +11665,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11637,7 +11726,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11698,7 +11787,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11759,7 +11848,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11820,7 +11909,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -11881,7 +11970,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11942,7 +12031,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11992,7 +12081,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12042,7 +12131,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12092,7 +12181,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12146,7 +12235,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12200,7 +12289,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12254,7 +12343,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12308,7 +12397,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12362,7 +12451,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12416,7 +12505,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 125, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12470,7 +12559,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12524,7 +12613,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -12600,7 +12689,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12759,7 +12848,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -12915,7 +13004,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13111,7 +13200,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13306,7 +13395,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13425,7 +13514,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13540,7 +13629,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13596,7 +13685,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -13657,7 +13746,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13730,7 +13819,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13803,7 +13892,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13879,7 +13968,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13995,7 +14084,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -14109,7 +14198,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14201,7 +14290,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14291,7 +14380,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14419,7 +14508,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14545,7 +14634,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -14649,7 +14738,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14751,7 +14840,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14867,7 +14956,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14981,7 +15070,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15141,7 +15230,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15298,7 +15387,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15402,7 +15491,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15504,7 +15593,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15608,7 +15697,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15710,7 +15799,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15814,7 +15903,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15916,7 +16005,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16020,7 +16109,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -16120,7 +16209,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16176,7 +16265,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16237,7 +16326,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16310,7 +16399,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16383,7 +16472,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16457,7 +16546,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16546,7 +16635,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16607,7 +16696,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16687,7 +16776,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16748,7 +16837,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16821,7 +16910,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16903,7 +16992,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16993,7 +17082,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17057,7 +17146,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -17130,7 +17219,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17203,7 +17292,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17341,7 +17430,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17401,7 +17490,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 206, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -17535,7 +17624,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17595,7 +17684,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 209, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -17680,7 +17769,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 208, + "weight": 209, "cookies": false, "type": "upload", "deprecated": false, @@ -17772,7 +17861,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 210, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -17844,7 +17933,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, @@ -17935,7 +18024,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, @@ -18007,7 +18096,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 212, + "weight": 213, "cookies": false, "type": "location", "deprecated": false, @@ -18079,7 +18168,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18279,7 +18368,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 213, + "weight": 214, "cookies": false, "type": "location", "deprecated": false, @@ -18351,7 +18440,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -18428,7 +18517,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18520,7 +18609,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18584,7 +18673,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18661,7 +18750,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18725,7 +18814,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18810,7 +18899,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18925,7 +19014,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -18997,7 +19086,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19085,7 +19174,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19159,7 +19248,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -19254,7 +19343,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19316,7 +19405,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19396,7 +19485,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -19469,7 +19558,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19565,7 +19654,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19657,7 +19746,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19747,7 +19836,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -19817,7 +19906,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -19879,7 +19968,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -19971,7 +20060,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20063,7 +20152,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -20190,7 +20279,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -20303,7 +20392,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20414,7 +20503,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -20469,7 +20558,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20531,7 +20620,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -20611,7 +20700,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 274, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -20694,7 +20783,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -20775,7 +20864,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20847,7 +20936,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -20909,7 +20998,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -20984,7 +21073,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -21057,7 +21146,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21117,7 +21206,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21177,7 +21266,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21237,7 +21326,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21299,7 +21388,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -21379,7 +21468,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21459,7 +21548,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21537,7 +21626,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21597,7 +21686,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21675,7 +21764,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21735,7 +21824,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21790,7 +21879,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -21847,7 +21936,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -21917,7 +22006,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -21995,7 +22084,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -22068,7 +22157,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -22180,7 +22269,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -22249,7 +22338,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -22340,7 +22429,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -22411,7 +22500,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22494,7 +22583,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22574,7 +22663,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, diff --git a/docs/examples/1.6.x/server-dart/examples/databases/create-documents.md b/docs/examples/1.6.x/server-dart/examples/databases/create-documents.md new file mode 100644 index 0000000000..9faa4ebf6f --- /dev/null +++ b/docs/examples/1.6.x/server-dart/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +DocumentList result = await databases.createDocuments( + databaseId: '', + collectionId: '', + documents: [], +); diff --git a/docs/examples/1.6.x/server-dart/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-dart/examples/databases/delete-documents.md new file mode 100644 index 0000000000..66bd5584c7 --- /dev/null +++ b/docs/examples/1.6.x/server-dart/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteDocuments( + databaseId: '', + collectionId: '', + queries: [], // (optional) +); diff --git a/docs/examples/1.6.x/server-dart/examples/databases/update-documents.md b/docs/examples/1.6.x/server-dart/examples/databases/update-documents.md new file mode 100644 index 0000000000..70b7cbf86d --- /dev/null +++ b/docs/examples/1.6.x/server-dart/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.updateDocuments( + databaseId: '', + collectionId: '', + data: {}, // (optional) + queries: [], // (optional) +); diff --git a/docs/examples/1.6.x/server-dart/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-dart/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..46611b3b1e --- /dev/null +++ b/docs/examples/1.6.x/server-dart/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.upsertDocuments( + databaseId: '', + collectionId: '', + documents: [], // (optional) +); diff --git a/docs/examples/1.6.x/server-deno/examples/databases/create-documents.md b/docs/examples/1.6.x/server-deno/examples/databases/create-documents.md new file mode 100644 index 0000000000..17c00e6785 --- /dev/null +++ b/docs/examples/1.6.x/server-deno/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new Databases(client); + +const response = await databases.createDocuments( + '', // databaseId + '', // collectionId + [] // documents +); diff --git a/docs/examples/1.6.x/server-deno/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-deno/examples/databases/delete-documents.md new file mode 100644 index 0000000000..4768ed426b --- /dev/null +++ b/docs/examples/1.6.x/server-deno/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); diff --git a/docs/examples/1.6.x/server-deno/examples/databases/update-documents.md b/docs/examples/1.6.x/server-deno/examples/databases/update-documents.md new file mode 100644 index 0000000000..1eef7794fb --- /dev/null +++ b/docs/examples/1.6.x/server-deno/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.updateDocuments( + '', // databaseId + '', // collectionId + {}, // data (optional) + [] // queries (optional) +); diff --git a/docs/examples/1.6.x/server-deno/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-deno/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..c0ee477875 --- /dev/null +++ b/docs/examples/1.6.x/server-deno/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.upsertDocuments( + '', // databaseId + '', // collectionId + [] // documents (optional) +); diff --git a/docs/examples/1.6.x/server-dotnet/examples/databases/create-documents.md b/docs/examples/1.6.x/server-dotnet/examples/databases/create-documents.md new file mode 100644 index 0000000000..8bfc420c4c --- /dev/null +++ b/docs/examples/1.6.x/server-dotnet/examples/databases/create-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +DocumentList result = await databases.CreateDocuments( + databaseId: "", + collectionId: "", + documents: new List() +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-dotnet/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-dotnet/examples/databases/delete-documents.md new file mode 100644 index 0000000000..a9bc9c277b --- /dev/null +++ b/docs/examples/1.6.x/server-dotnet/examples/databases/delete-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +await databases.DeleteDocuments( + databaseId: "", + collectionId: "", + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-dotnet/examples/databases/update-documents.md b/docs/examples/1.6.x/server-dotnet/examples/databases/update-documents.md new file mode 100644 index 0000000000..63ded21ac9 --- /dev/null +++ b/docs/examples/1.6.x/server-dotnet/examples/databases/update-documents.md @@ -0,0 +1,17 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpdateDocuments( + databaseId: "", + collectionId: "", + data: [object], // optional + queries: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-dotnet/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-dotnet/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..d9db60ce2d --- /dev/null +++ b/docs/examples/1.6.x/server-dotnet/examples/databases/upsert-documents.md @@ -0,0 +1,16 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("") // Your project ID + .SetKey(""); // Your secret API key + +Databases databases = new Databases(client); + +DocumentList result = await databases.UpsertDocuments( + databaseId: "", + collectionId: "", + documents: new List() // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-go/examples/databases/create-documents.md b/docs/examples/1.6.x/server-go/examples/databases/create-documents.md new file mode 100644 index 0000000000..0617f12687 --- /dev/null +++ b/docs/examples/1.6.x/server-go/examples/databases/create-documents.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.NewClient() + + client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.SetProject("") // Your project ID + client.SetSession("") // The user session to authenticate with + + service := databases.NewDatabases(client) + response, error := service.CreateDocuments( + "", + "", + []interface{}{}, + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.6.x/server-go/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-go/examples/databases/delete-documents.md new file mode 100644 index 0000000000..6527cee677 --- /dev/null +++ b/docs/examples/1.6.x/server-go/examples/databases/delete-documents.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.NewClient() + + client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.SetProject("") // Your project ID + client.SetKey("") // Your secret API key + + service := databases.NewDatabases(client) + response, error := service.DeleteDocuments( + "", + "", + databases.WithDeleteDocumentsQueries([]interface{}{}), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.6.x/server-go/examples/databases/update-documents.md b/docs/examples/1.6.x/server-go/examples/databases/update-documents.md new file mode 100644 index 0000000000..e654590691 --- /dev/null +++ b/docs/examples/1.6.x/server-go/examples/databases/update-documents.md @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.NewClient() + + client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.SetProject("") // Your project ID + client.SetKey("") // Your secret API key + + service := databases.NewDatabases(client) + response, error := service.UpdateDocuments( + "", + "", + databases.WithUpdateDocumentsData(map[string]interface{}{}), + databases.WithUpdateDocumentsQueries([]interface{}{}), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.6.x/server-go/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-go/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..a8399f79c0 --- /dev/null +++ b/docs/examples/1.6.x/server-go/examples/databases/upsert-documents.md @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/databases" +) + +func main() { + client := client.NewClient() + + client.SetEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + client.SetProject("") // Your project ID + client.SetKey("") // Your secret API key + + service := databases.NewDatabases(client) + response, error := service.UpsertDocuments( + "", + "", + databases.WithUpsertDocumentsDocuments([]interface{}{}), + ) + + if error != nil { + panic(error) + } + + fmt.Println(response) +} diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-documents.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-documents.md new file mode 100644 index 0000000000..3e3a50f3ab --- /dev/null +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-documents.md @@ -0,0 +1,18 @@ +mutation { + databasesCreateDocuments( + databaseId: "", + collectionId: "", + documents: [] + ) { + total + documents { + _id + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-graphql/examples/databases/delete-documents.md new file mode 100644 index 0000000000..ad5826f22a --- /dev/null +++ b/docs/examples/1.6.x/server-graphql/examples/databases/delete-documents.md @@ -0,0 +1,18 @@ +mutation { + databasesDeleteDocuments( + databaseId: "", + collectionId: "", + queries: [] + ) { + total + documents { + _id + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-documents.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-documents.md new file mode 100644 index 0000000000..c05acb16a0 --- /dev/null +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-documents.md @@ -0,0 +1,19 @@ +mutation { + databasesUpdateDocuments( + databaseId: "", + collectionId: "", + data: "{}", + queries: [] + ) { + total + documents { + _id + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-graphql/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..d6e7bba9a3 --- /dev/null +++ b/docs/examples/1.6.x/server-graphql/examples/databases/upsert-documents.md @@ -0,0 +1,18 @@ +mutation { + databasesUpsertDocuments( + databaseId: "", + collectionId: "", + documents: [] + ) { + total + documents { + _id + _collectionId + _databaseId + _createdAt + _updatedAt + _permissions + data + } + } +} diff --git a/docs/examples/1.6.x/server-kotlin/java/databases/create-documents.md b/docs/examples/1.6.x/server-kotlin/java/databases/create-documents.md new file mode 100644 index 0000000000..c788fa7017 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/java/databases/create-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +databases.createDocuments( + "", // databaseId + "", // collectionId + listOf(), // documents + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.6.x/server-kotlin/java/databases/delete-documents.md b/docs/examples/1.6.x/server-kotlin/java/databases/delete-documents.md new file mode 100644 index 0000000000..e8394b1ff9 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/java/databases/delete-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.deleteDocuments( + "", // databaseId + "", // collectionId + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.6.x/server-kotlin/java/databases/update-documents.md b/docs/examples/1.6.x/server-kotlin/java/databases/update-documents.md new file mode 100644 index 0000000000..b4138b41d2 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/java/databases/update-documents.md @@ -0,0 +1,26 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.updateDocuments( + "", // databaseId + "", // collectionId + mapOf( "a" to "b" ), // data (optional) + listOf(), // queries (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.6.x/server-kotlin/java/databases/upsert-documents.md b/docs/examples/1.6.x/server-kotlin/java/databases/upsert-documents.md new file mode 100644 index 0000000000..e2f2a46337 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/java/databases/upsert-documents.md @@ -0,0 +1,25 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Databases; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Databases databases = new Databases(client); + +databases.upsertDocuments( + "", // databaseId + "", // collectionId + listOf(), // documents (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/databases/create-documents.md b/docs/examples/1.6.x/server-kotlin/kotlin/databases/create-documents.md new file mode 100644 index 0000000000..d9af7b000c --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/kotlin/databases/create-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +val databases = Databases(client) + +val response = databases.createDocuments( + databaseId = "", + collectionId = "", + documents = listOf() +) diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/databases/delete-documents.md b/docs/examples/1.6.x/server-kotlin/kotlin/databases/delete-documents.md new file mode 100644 index 0000000000..c4caa63aae --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/kotlin/databases/delete-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.deleteDocuments( + databaseId = "", + collectionId = "", + queries = listOf() // optional +) diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-documents.md b/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-documents.md new file mode 100644 index 0000000000..9d6c2b5ea8 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-documents.md @@ -0,0 +1,17 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.updateDocuments( + databaseId = "", + collectionId = "", + data = mapOf( "a" to "b" ), // optional + queries = listOf() // optional +) diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/databases/upsert-documents.md b/docs/examples/1.6.x/server-kotlin/kotlin/databases/upsert-documents.md new file mode 100644 index 0000000000..7459b384a1 --- /dev/null +++ b/docs/examples/1.6.x/server-kotlin/kotlin/databases/upsert-documents.md @@ -0,0 +1,16 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Databases + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val databases = Databases(client) + +val response = databases.upsertDocuments( + databaseId = "", + collectionId = "", + documents = listOf() // optional +) diff --git a/docs/examples/1.6.x/server-nodejs/examples/databases/create-documents.md b/docs/examples/1.6.x/server-nodejs/examples/databases/create-documents.md new file mode 100644 index 0000000000..cc8fd01a60 --- /dev/null +++ b/docs/examples/1.6.x/server-nodejs/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.createDocuments( + '', // databaseId + '', // collectionId + [] // documents +); diff --git a/docs/examples/1.6.x/server-nodejs/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-nodejs/examples/databases/delete-documents.md new file mode 100644 index 0000000000..01814e5052 --- /dev/null +++ b/docs/examples/1.6.x/server-nodejs/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); diff --git a/docs/examples/1.6.x/server-nodejs/examples/databases/update-documents.md b/docs/examples/1.6.x/server-nodejs/examples/databases/update-documents.md new file mode 100644 index 0000000000..62b2271bae --- /dev/null +++ b/docs/examples/1.6.x/server-nodejs/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocuments( + '', // databaseId + '', // collectionId + {}, // data (optional) + [] // queries (optional) +); diff --git a/docs/examples/1.6.x/server-nodejs/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-nodejs/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..5b4795627d --- /dev/null +++ b/docs/examples/1.6.x/server-nodejs/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocuments( + '', // databaseId + '', // collectionId + [] // documents (optional) +); diff --git a/docs/examples/1.6.x/server-php/examples/databases/create-documents.md b/docs/examples/1.6.x/server-php/examples/databases/create-documents.md new file mode 100644 index 0000000000..0ca02bfa03 --- /dev/null +++ b/docs/examples/1.6.x/server-php/examples/databases/create-documents.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setSession(''); // The user session to authenticate with + +$databases = new Databases($client); + +$result = $databases->createDocuments( + databaseId: '', + collectionId: '', + documents: [] +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-php/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-php/examples/databases/delete-documents.md new file mode 100644 index 0000000000..3552d85317 --- /dev/null +++ b/docs/examples/1.6.x/server-php/examples/databases/delete-documents.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->deleteDocuments( + databaseId: '', + collectionId: '', + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-php/examples/databases/update-documents.md b/docs/examples/1.6.x/server-php/examples/databases/update-documents.md new file mode 100644 index 0000000000..51b4e18bc2 --- /dev/null +++ b/docs/examples/1.6.x/server-php/examples/databases/update-documents.md @@ -0,0 +1,18 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->updateDocuments( + databaseId: '', + collectionId: '', + data: [], // optional + queries: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-php/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-php/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..7b9459e8f4 --- /dev/null +++ b/docs/examples/1.6.x/server-php/examples/databases/upsert-documents.md @@ -0,0 +1,17 @@ +setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('') // Your project ID + ->setKey(''); // Your secret API key + +$databases = new Databases($client); + +$result = $databases->upsertDocuments( + databaseId: '', + collectionId: '', + documents: [] // optional +); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-documents.md b/docs/examples/1.6.x/server-python/examples/databases/create-documents.md new file mode 100644 index 0000000000..1178a0f735 --- /dev/null +++ b/docs/examples/1.6.x/server-python/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_session('') # The user session to authenticate with + +databases = Databases(client) + +result = databases.create_documents( + database_id = '', + collection_id = '', + documents = [] +) diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-python/examples/databases/delete-documents.md new file mode 100644 index 0000000000..a315f0c200 --- /dev/null +++ b/docs/examples/1.6.x/server-python/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_key('') # Your secret API key + +databases = Databases(client) + +result = databases.delete_documents( + database_id = '', + collection_id = '', + queries = [] # optional +) diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-documents.md b/docs/examples/1.6.x/server-python/examples/databases/update-documents.md new file mode 100644 index 0000000000..5a50d1a912 --- /dev/null +++ b/docs/examples/1.6.x/server-python/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_key('') # Your secret API key + +databases = Databases(client) + +result = databases.update_documents( + database_id = '', + collection_id = '', + data = {}, # optional + queries = [] # optional +) diff --git a/docs/examples/1.6.x/server-python/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-python/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..99720649d6 --- /dev/null +++ b/docs/examples/1.6.x/server-python/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +from appwrite.client import Client +from appwrite.services.databases import Databases + +client = Client() +client.set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('') # Your project ID +client.set_key('') # Your secret API key + +databases = Databases(client) + +result = databases.upsert_documents( + database_id = '', + collection_id = '', + documents = [] # optional +) diff --git a/docs/examples/1.6.x/server-rest/examples/databases/create-documents.md b/docs/examples/1.6.x/server-rest/examples/databases/create-documents.md new file mode 100644 index 0000000000..892510cf6f --- /dev/null +++ b/docs/examples/1.6.x/server-rest/examples/databases/create-documents.md @@ -0,0 +1,12 @@ +POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.6.0 +X-Appwrite-Project: +X-Appwrite-Session: +X-Appwrite-Key: +X-Appwrite-JWT: + +{ + "documents": [] +} diff --git a/docs/examples/1.6.x/server-rest/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-rest/examples/databases/delete-documents.md new file mode 100644 index 0000000000..daf782fd2c --- /dev/null +++ b/docs/examples/1.6.x/server-rest/examples/databases/delete-documents.md @@ -0,0 +1,10 @@ +DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.6.0 +X-Appwrite-Project: +X-Appwrite-Key: + +{ + "queries": [] +} diff --git a/docs/examples/1.6.x/server-rest/examples/databases/update-documents.md b/docs/examples/1.6.x/server-rest/examples/databases/update-documents.md new file mode 100644 index 0000000000..71fdbf9c63 --- /dev/null +++ b/docs/examples/1.6.x/server-rest/examples/databases/update-documents.md @@ -0,0 +1,11 @@ +PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.6.0 +X-Appwrite-Project: +X-Appwrite-Key: + +{ + "data": {}, + "queries": [] +} diff --git a/docs/examples/1.6.x/server-rest/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-rest/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..c374b43043 --- /dev/null +++ b/docs/examples/1.6.x/server-rest/examples/databases/upsert-documents.md @@ -0,0 +1,10 @@ +PUT /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1 +Host: cloud.appwrite.io +Content-Type: application/json +X-Appwrite-Response-Format: 1.6.0 +X-Appwrite-Project: +X-Appwrite-Key: + +{ + "documents": [] +} diff --git a/docs/examples/1.6.x/server-ruby/examples/databases/create-documents.md b/docs/examples/1.6.x/server-ruby/examples/databases/create-documents.md new file mode 100644 index 0000000000..98eadab57d --- /dev/null +++ b/docs/examples/1.6.x/server-ruby/examples/databases/create-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_session('') # The user session to authenticate with + +databases = Databases.new(client) + +result = databases.create_documents( + database_id: '', + collection_id: '', + documents: [] +) diff --git a/docs/examples/1.6.x/server-ruby/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-ruby/examples/databases/delete-documents.md new file mode 100644 index 0000000000..d0f10d0b41 --- /dev/null +++ b/docs/examples/1.6.x/server-ruby/examples/databases/delete-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +databases = Databases.new(client) + +result = databases.delete_documents( + database_id: '', + collection_id: '', + queries: [] # optional +) diff --git a/docs/examples/1.6.x/server-ruby/examples/databases/update-documents.md b/docs/examples/1.6.x/server-ruby/examples/databases/update-documents.md new file mode 100644 index 0000000000..2f6907294f --- /dev/null +++ b/docs/examples/1.6.x/server-ruby/examples/databases/update-documents.md @@ -0,0 +1,17 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +databases = Databases.new(client) + +result = databases.update_documents( + database_id: '', + collection_id: '', + data: {}, # optional + queries: [] # optional +) diff --git a/docs/examples/1.6.x/server-ruby/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-ruby/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..353e38fe2b --- /dev/null +++ b/docs/examples/1.6.x/server-ruby/examples/databases/upsert-documents.md @@ -0,0 +1,16 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +databases = Databases.new(client) + +result = databases.upsert_documents( + database_id: '', + collection_id: '', + documents: [] # optional +) diff --git a/docs/examples/1.6.x/server-swift/examples/databases/create-documents.md b/docs/examples/1.6.x/server-swift/examples/databases/create-documents.md new file mode 100644 index 0000000000..f7c076eaea --- /dev/null +++ b/docs/examples/1.6.x/server-swift/examples/databases/create-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setSession("") // The user session to authenticate with + +let databases = Databases(client) + +let documentList = try await databases.createDocuments( + databaseId: "", + collectionId: "", + documents: [] +) + diff --git a/docs/examples/1.6.x/server-swift/examples/databases/delete-documents.md b/docs/examples/1.6.x/server-swift/examples/databases/delete-documents.md new file mode 100644 index 0000000000..d5321f2b26 --- /dev/null +++ b/docs/examples/1.6.x/server-swift/examples/databases/delete-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.deleteDocuments( + databaseId: "", + collectionId: "", + queries: [] // optional +) + diff --git a/docs/examples/1.6.x/server-swift/examples/databases/update-documents.md b/docs/examples/1.6.x/server-swift/examples/databases/update-documents.md new file mode 100644 index 0000000000..0e934b1424 --- /dev/null +++ b/docs/examples/1.6.x/server-swift/examples/databases/update-documents.md @@ -0,0 +1,16 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.updateDocuments( + databaseId: "", + collectionId: "", + data: [:], // optional + queries: [] // optional +) + diff --git a/docs/examples/1.6.x/server-swift/examples/databases/upsert-documents.md b/docs/examples/1.6.x/server-swift/examples/databases/upsert-documents.md new file mode 100644 index 0000000000..353cc5c502 --- /dev/null +++ b/docs/examples/1.6.x/server-swift/examples/databases/upsert-documents.md @@ -0,0 +1,15 @@ +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +let databases = Databases(client) + +let documentList = try await databases.upsertDocuments( + databaseId: "", + collectionId: "", + documents: [] // optional +) + From 6f39c9d1476d278afd277c5d8af9c90fddc82e7e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 9 May 2025 00:11:54 +1200 Subject: [PATCH 159/161] Update database --- app/controllers/api/databases.php | 2 -- composer.json | 2 +- composer.lock | 14 +++++++------- docs/references/databases/create-documents.md | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index d988f72b15..0bdb42ec1c 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3982,7 +3982,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->inject('queueForEvents') ->inject('queueForStatsUsage') ->action(function (string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { - $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array if (empty($data) && \is_null($permissions)) { @@ -3999,7 +3998,6 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum } $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); - if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } diff --git a/composer.json b/composer.json index 2a8b059873..9e45f71c61 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.67.*", + "utopia-php/database": "0.68.*", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 5fef0d96c7..d3131c88ed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c140ba66f30878720ebe009abc158a7", + "content-hash": "a5c4c6b723423bc6cb3a7344ab071b43", "packages": [ { "name": "adhocore/jwt", @@ -3499,16 +3499,16 @@ }, { "name": "utopia-php/database", - "version": "0.67.5", + "version": "0.68.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "74035473d999cb0675ca6bb0b4f604e9f19e5bc8" + "reference": "f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/74035473d999cb0675ca6bb0b4f604e9f19e5bc8", - "reference": "74035473d999cb0675ca6bb0b4f604e9f19e5bc8", + "url": "https://api.github.com/repos/utopia-php/database/zipball/f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad", + "reference": "f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad", "shasum": "" }, "require": { @@ -3549,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.67.5" + "source": "https://github.com/utopia-php/database/tree/0.68.0" }, - "time": "2025-05-08T09:59:59+00:00" + "time": "2025-05-08T12:01:20+00:00" }, { "name": "utopia-php/domains", diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md index a7d31450ef..a02d7c8bf1 100644 --- a/docs/references/databases/create-documents.md +++ b/docs/references/databases/create-documents.md @@ -1 +1 @@ -Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. +Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. \ No newline at end of file From 2c8e1e1731533ad75447c17e982290b0ec0b4e8e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 8 May 2025 13:44:58 +0000 Subject: [PATCH 160/161] chore: deprecate delay --- .env | 3 +-- app/config/variables.php | 2 +- docker-compose.yml | 1 - src/Appwrite/Platform/Tasks/Maintenance.php | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.env b/.env index a1f8cfafc6..89b76cb740 100644 --- a/.env +++ b/.env @@ -82,8 +82,7 @@ _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://proxy/v1 _APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 _APP_MAINTENANCE_INTERVAL=86400 -_APP_MAINTENANCE_DELAY= -_APP_MAINTENANCE_START_TIME= +_APP_MAINTENANCE_START_TIME=12:00 _APP_MAINTENANCE_RETENTION_CACHE=2592000 _APP_MAINTENANCE_RETENTION_EXECUTION=1209600 _APP_MAINTENANCE_RETENTION_ABUSE=86400 diff --git a/app/config/variables.php b/app/config/variables.php index 297f11bd89..f79d4cb517 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -1030,7 +1030,7 @@ return [ ], [ 'name' => '_APP_MAINTENANCE_DELAY', - 'description' => 'Delay value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 0 seconds.', + 'description' => 'Deprecated with 1.6.2 use _APP_MAINTENANCE_START_TIME instead to run the maintenance at a specific time per day.', 'introduction' => '1.5.0', 'default' => '0', 'required' => false, diff --git a/docker-compose.yml b/docker-compose.yml index ac6530fd5b..7ea2fceadc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -732,7 +732,6 @@ services: - _APP_MAINTENANCE_RETENTION_AUDIT_CONSOLE - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_MAINTENANCE_RETENTION_SCHEDULES - - _APP_MAINTENANCE_DELAY - _APP_MAINTENANCE_START_TIME - _APP_DATABASE_SHARED_TABLES diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index 83533a7698..bb815e50bd 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -36,7 +36,6 @@ class Maintenance extends Action Console::success(APP_NAME . ' maintenance process v1 has started'); $interval = (int) System::getEnv('_APP_MAINTENANCE_INTERVAL', '86400'); // 1 day - $delay = (int) System::getEnv('_APP_MAINTENANCE_DELAY', '0'); // 0 seconds $usageStatsRetentionHourly = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_USAGE_HOURLY', '8640000'); //100 days $cacheRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_CACHE', '2592000'); // 30 days $schedulesDeletionRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_SCHEDULES', '86400'); // 1 Day From de7c8b8c27970e6b809a59ff42200c2b38ef91fe Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 10 May 2025 18:27:20 +1200 Subject: [PATCH 161/161] Update deps --- composer.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index d3131c88ed..b56b7b387d 100644 --- a/composer.lock +++ b/composer.lock @@ -3301,16 +3301,16 @@ }, { "name": "utopia-php/cache", - "version": "0.13.0", + "version": "0.13.1", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3" + "reference": "97220cb3b3822b166ee016d1646e2ae2815dc540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/dee01dec33a211644d60f6cfa56b1b8176d3fae3", - "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/97220cb3b3822b166ee016d1646e2ae2815dc540", + "reference": "97220cb3b3822b166ee016d1646e2ae2815dc540", "shasum": "" }, "require": { @@ -3347,9 +3347,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.13.0" + "source": "https://github.com/utopia-php/cache/tree/0.13.1" }, - "time": "2025-04-17T04:20:26+00:00" + "time": "2025-05-09T14:43:52+00:00" }, { "name": "utopia-php/cli", @@ -3499,16 +3499,16 @@ }, { "name": "utopia-php/database", - "version": "0.68.0", + "version": "0.68.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad" + "reference": "72b2e2c0b875028f7d9dd755f6d4524b693c6507" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad", - "reference": "f9c2b6b4e7a17f0890d3fb6238b03dae6b2670ad", + "url": "https://api.github.com/repos/utopia-php/database/zipball/72b2e2c0b875028f7d9dd755f6d4524b693c6507", + "reference": "72b2e2c0b875028f7d9dd755f6d4524b693c6507", "shasum": "" }, "require": { @@ -3549,9 +3549,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.68.0" + "source": "https://github.com/utopia-php/database/tree/0.68.1" }, - "time": "2025-05-08T12:01:20+00:00" + "time": "2025-05-09T10:08:53+00:00" }, { "name": "utopia-php/domains", @@ -4595,16 +4595,16 @@ }, { "name": "utopia-php/websocket", - "version": "0.3.0", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/websocket.git", - "reference": "629e53640b108eab43c7cc9ab375efade8622d43" + "reference": "77004ba9f66a0ab6eb840a85b2af332fca8f6bd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/websocket/zipball/629e53640b108eab43c7cc9ab375efade8622d43", - "reference": "629e53640b108eab43c7cc9ab375efade8622d43", + "url": "https://api.github.com/repos/utopia-php/websocket/zipball/77004ba9f66a0ab6eb840a85b2af332fca8f6bd9", + "reference": "77004ba9f66a0ab6eb840a85b2af332fca8f6bd9", "shasum": "" }, "require": { @@ -4638,9 +4638,9 @@ ], "support": { "issues": "https://github.com/utopia-php/websocket/issues", - "source": "https://github.com/utopia-php/websocket/tree/0.3.0" + "source": "https://github.com/utopia-php/websocket/tree/0.3.1" }, - "time": "2025-03-28T01:11:13+00:00" + "time": "2025-05-09T12:57:42+00:00" }, { "name": "webmozart/assert",