diff --git a/app/cli.php b/app/cli.php index 07966b2450..4b85ba35c6 100644 --- a/app/cli.php +++ b/app/cli.php @@ -41,8 +41,6 @@ Config::setParam('runtimes', (new Runtimes('v5'))->getAll(supported: false)); // require controllers after overwriting runtimes require_once __DIR__ . '/controllers/general.php'; -Authorization::disable(); - CLI::setResource('register', fn () => $register); CLI::setResource('cache', function ($pools) { @@ -60,7 +58,13 @@ CLI::setResource('pools', function (Registry $register) { return $register->get('pools'); }, ['register']); -CLI::setResource('dbForPlatform', function ($pools, $cache) { +CLI::setResource('authorization', function () { + $authorization = new Authorization(); + $authorization->disable(); + return $authorization; +}, []); + +CLI::setResource('dbForPlatform', function ($pools, $cache, $authorization) { $sleep = 3; $maxAttempts = 5; $attempts = 0; @@ -74,6 +78,8 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) { $dbForPlatform = new Database($adapter, $cache); $dbForPlatform + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setNamespace('_console') ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console'); @@ -99,7 +105,7 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) { } return $dbForPlatform; -}, ['pools', 'cache']); +}, ['pools', 'cache', 'authorization']); CLI::setResource('console', function () { return new Document(Config::getParam('console')); @@ -110,10 +116,10 @@ CLI::setResource( fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false ); -CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { +CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, $authorization) { $databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools - return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) { + return function (Document $project) use ($pools, $dbForPlatform, $cache, $authorization, &$databases) { if ($project->isEmpty() || $project->getId() === 'console') { return $dbForPlatform; } @@ -146,6 +152,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform $adapter = new DatabasePool($pools->get($dsn->getHost())); $database = new Database($adapter, $cache); + $databases[$dsn->getHost()] = $database; $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); @@ -162,17 +169,19 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform } $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setMetadata('host', \gethostname()) ->setMetadata('project', $project->getId()); return $database; }; -}, ['pools', 'dbForPlatform', 'cache']); +}, ['pools', 'dbForPlatform', 'cache', 'authorization']); -CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { +CLI::setResource('getLogsDB', function (Group $pools, Cache $cache, Authorization $authorization) { $database = null; - return function (?Document $project = null) use ($pools, $cache, $database) { + return function (?Document $project = null) use ($pools, $cache, $database, $authorization) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { $database->setTenant((int)$project->getSequence()); return $database; @@ -182,6 +191,8 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = new Database($adapter, $cache); $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setSharedTables(true) ->setNamespace('logsV1') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_TASK) @@ -194,7 +205,7 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { return $database; }; -}, ['pools', 'cache']); +}, ['pools', 'cache', 'authorization']); CLI::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); diff --git a/app/config/sdks.php b/app/config/sdks.php index 9b5d17176f..41dee55080 100644 --- a/app/config/sdks.php +++ b/app/config/sdks.php @@ -60,7 +60,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '20.3.2', + 'version' => '20.3.3', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -227,7 +227,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '12.0.1', + 'version' => '13.0.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -377,7 +377,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '20.1.0', + 'version' => '20.1.1', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json index 052fe536c9..942e83c234 100644 --- a/app/config/specs/open-api3-1.8.x-client.json +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -140,7 +140,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -224,12 +225,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -439,7 +442,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -551,7 +555,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -623,7 +627,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -747,7 +751,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -887,7 +891,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1011,7 +1015,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1145,7 +1149,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1283,7 +1287,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1384,7 +1388,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1483,7 +1487,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1582,7 +1586,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1796,7 +1800,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1868,12 +1873,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2072,12 +2079,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2382,12 +2391,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2573,9 +2584,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3304,7 +3313,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3390,12 +3400,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3504,9 +3516,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3621,7 +3631,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3746,7 +3757,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4039,7 +4051,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4167,7 +4179,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4301,7 +4313,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4361,7 +4373,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4851,7 +4863,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4935,7 +4947,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5029,7 +5041,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5123,7 +5135,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5980,7 +5992,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7146,12 +7159,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7273,12 +7288,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7318,7 +7335,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -7405,7 +7422,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -7523,7 +7540,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7598,7 +7615,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -7652,7 +7669,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -7706,7 +7723,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -7760,7 +7777,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -7814,7 +7831,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -7868,7 +7885,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -7922,7 +7939,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -7976,7 +7993,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -8030,7 +8047,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -8084,7 +8101,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -8138,7 +8155,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -8222,7 +8239,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -8298,7 +8315,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -8397,7 +8414,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -8452,7 +8469,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -8498,7 +8516,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -8572,7 +8590,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -8664,7 +8682,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -8733,7 +8751,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -8813,7 +8831,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -9043,7 +9061,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -9240,7 +9258,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -10403,12 +10422,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10529,12 +10550,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10574,7 +10597,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -10663,7 +10686,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -10750,7 +10773,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -10814,7 +10837,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -10890,7 +10913,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -10956,7 +10979,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -11055,7 +11078,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -11104,7 +11127,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -11114,7 +11138,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -11134,7 +11159,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -11175,7 +11201,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -11249,7 +11275,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -11345,7 +11371,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -11421,7 +11447,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -11521,7 +11547,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -11584,7 +11610,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index de68c4db48..f7cbca76a5 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -138,7 +138,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -261,12 +262,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -473,7 +476,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -584,7 +588,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -655,7 +659,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -778,7 +782,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -917,7 +921,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1040,7 +1044,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1173,7 +1177,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1310,7 +1314,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1410,7 +1414,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1508,7 +1512,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1606,7 +1610,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1817,7 +1821,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1888,12 +1893,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2089,12 +2096,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2394,12 +2403,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2583,9 +2594,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3304,7 +3313,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3389,12 +3399,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3502,9 +3514,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3618,7 +3628,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3742,7 +3753,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4032,7 +4044,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4160,7 +4172,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4294,7 +4306,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4354,7 +4366,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4844,7 +4856,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4928,7 +4940,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5022,7 +5034,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5116,7 +5128,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5862,7 +5874,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 495, + "weight": 496, "cookies": false, "type": "", "demo": "assistant\/chat.md", @@ -5923,7 +5935,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 496, + "weight": 497, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -5998,7 +6010,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 494, + "weight": 495, "cookies": false, "type": "", "demo": "console\/variables.md", @@ -6387,7 +6399,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -8239,6 +8252,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -8356,6 +8370,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8719,18 +8734,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8848,18 +8866,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8974,18 +8995,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -9103,18 +9127,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -10310,7 +10337,8 @@ "size": { "type": "integer", "description": "Attribute size for text attributes, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -10450,6 +10478,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10564,6 +10593,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10681,6 +10711,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -12346,12 +12377,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12473,12 +12506,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -13331,7 +13366,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -13416,7 +13451,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 435, + "weight": 436, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -13556,7 +13591,8 @@ "timeout": { "type": "integer", "description": "Function maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13711,7 +13747,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -13761,7 +13797,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -13811,7 +13847,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 464, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -14003,7 +14039,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 463, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -14063,7 +14099,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 457, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -14135,7 +14171,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 436, + "weight": 437, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -14195,7 +14231,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -14342,7 +14378,8 @@ "timeout": { "type": "integer", "description": "Maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14487,7 +14524,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -14549,7 +14586,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 444, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -14630,7 +14667,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 445, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -14725,7 +14762,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 442, + "weight": 443, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -14782,7 +14819,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -14824,7 +14862,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 450, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -14910,7 +14948,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 447, + "weight": 448, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -15027,7 +15065,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 448, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -15125,7 +15163,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 443, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -15188,7 +15226,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 446, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -15253,7 +15291,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 449, + "weight": 450, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -15344,7 +15382,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 451, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -15416,7 +15454,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -15503,7 +15541,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -15621,7 +15659,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -15687,7 +15725,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 455, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -15759,7 +15797,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 456, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -15841,7 +15879,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 460, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -15901,7 +15939,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 458, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -15993,7 +16031,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 459, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -16063,7 +16101,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 461, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -16157,7 +16195,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 462, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -16229,7 +16267,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -16283,7 +16321,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -16337,7 +16375,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -16388,7 +16426,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -16439,7 +16477,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -16490,7 +16528,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -16552,7 +16590,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -16603,7 +16641,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -16654,7 +16692,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -16718,7 +16756,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -16782,7 +16820,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -16857,7 +16895,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -16921,7 +16959,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -16965,6 +17003,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -17011,7 +17050,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -17075,7 +17114,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -17139,7 +17178,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -17203,7 +17242,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -17267,7 +17306,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -17331,7 +17370,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -17395,7 +17434,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -17459,7 +17498,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -17523,7 +17562,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -17574,7 +17613,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -17625,7 +17664,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -17676,7 +17715,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -17730,7 +17769,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -17784,7 +17823,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -17838,7 +17877,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -17892,7 +17931,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -17946,7 +17985,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -18000,7 +18039,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -18054,7 +18093,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -18108,7 +18147,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -18196,7 +18235,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -18342,7 +18381,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -18500,7 +18539,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -18609,7 +18648,8 @@ "badge": { "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -18677,7 +18717,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -18805,6 +18845,7 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS platforms.", "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -18874,7 +18915,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -19055,7 +19096,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -19242,7 +19283,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -19296,7 +19337,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -19359,7 +19400,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -19446,7 +19487,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -19533,7 +19574,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -19621,7 +19662,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -19800,7 +19841,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -19981,7 +20022,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -20133,7 +20174,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -20286,7 +20327,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -20351,7 +20392,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20361,7 +20403,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20404,7 +20447,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -20482,7 +20525,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20525,7 +20569,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -20622,7 +20666,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -20722,7 +20766,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -20776,7 +20820,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20786,7 +20831,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20829,7 +20875,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -20896,7 +20942,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20939,7 +20986,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -20993,7 +21040,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21003,7 +21051,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21046,7 +21095,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -21113,7 +21162,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21156,7 +21206,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -21291,7 +21341,8 @@ "port": { "type": "integer", "description": "The default SMTP server port.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -21333,7 +21384,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21343,7 +21395,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21387,7 +21440,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -21526,6 +21579,7 @@ "type": "integer", "description": "SMTP port.", "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -21569,7 +21623,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21618,7 +21673,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -21662,7 +21717,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -21715,7 +21771,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -21815,7 +21871,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -21859,7 +21915,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -21912,7 +21969,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -22012,7 +22069,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -22056,7 +22113,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -22109,7 +22167,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -22209,7 +22267,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -22253,7 +22311,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -22306,7 +22365,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -22406,7 +22465,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -22460,7 +22519,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -22523,7 +22582,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -22610,7 +22669,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -22697,7 +22756,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -22783,7 +22842,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -22867,7 +22926,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -22928,7 +22987,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -23008,7 +23067,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -23071,7 +23130,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -23158,7 +23217,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -23254,7 +23313,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -23345,7 +23404,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -23409,7 +23468,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -23485,7 +23544,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 232, + "weight": 221, "cookies": false, "type": "", "demo": "migrations\/list.md", @@ -23571,7 +23630,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 226, + "weight": 215, "cookies": false, "type": "", "demo": "migrations\/create-appwrite-migration.md", @@ -23631,7 +23690,8 @@ "endpoint": { "type": "string", "description": "Source Appwrite endpoint", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "projectId": { "type": "string", @@ -23680,7 +23740,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 234, + "weight": 223, "cookies": false, "type": "", "demo": "migrations\/get-appwrite-report.md", @@ -23794,7 +23854,7 @@ "x-appwrite": { "method": "createCSVExport", "group": null, - "weight": 231, + "weight": 220, "cookies": false, "type": "", "demo": "migrations\/create-csv-export.md", @@ -23909,7 +23969,7 @@ "x-appwrite": { "method": "createCSVImport", "group": null, - "weight": 230, + "weight": 219, "cookies": false, "type": "", "demo": "migrations\/create-csv-import.md", @@ -23994,7 +24054,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 227, + "weight": 216, "cookies": false, "type": "", "demo": "migrations\/create-firebase-migration.md", @@ -24085,7 +24145,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 235, + "weight": 224, "cookies": false, "type": "", "demo": "migrations\/get-firebase-report.md", @@ -24172,7 +24232,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 229, + "weight": 218, "cookies": false, "type": "", "demo": "migrations\/create-n-host-migration.md", @@ -24257,7 +24317,8 @@ "port": { "type": "integer", "description": "Source's Database Port", - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24299,7 +24360,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 237, + "weight": 226, "cookies": false, "type": "", "demo": "migrations\/get-n-host-report.md", @@ -24448,7 +24509,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 228, + "weight": 217, "cookies": false, "type": "", "demo": "migrations\/create-supabase-migration.md", @@ -24503,7 +24564,8 @@ "endpoint": { "type": "string", "description": "Source's Supabase Endpoint", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "apiKey": { "type": "string", @@ -24528,7 +24590,8 @@ "port": { "type": "integer", "description": "Source's Database Port", - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24569,7 +24632,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 236, + "weight": 225, "cookies": false, "type": "", "demo": "migrations\/get-supabase-report.md", @@ -24709,7 +24772,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 233, + "weight": 222, "cookies": false, "type": "", "demo": "migrations\/get.md", @@ -24768,7 +24831,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 238, + "weight": 227, "cookies": false, "type": "", "demo": "migrations\/retry.md", @@ -24820,7 +24883,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 239, + "weight": 228, "cookies": false, "type": "", "demo": "migrations\/delete.md", @@ -24881,7 +24944,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 138, + "weight": 127, "cookies": false, "type": "", "demo": "project\/get-usage.md", @@ -24970,7 +25033,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 140, + "weight": 129, "cookies": false, "type": "", "demo": "project\/list-variables.md", @@ -25017,7 +25080,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 139, + "weight": 128, "cookies": false, "type": "", "demo": "project\/create-variable.md", @@ -25096,7 +25159,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 141, + "weight": 130, "cookies": false, "type": "", "demo": "project\/get-variable.md", @@ -25155,7 +25218,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 142, + "weight": 131, "cookies": false, "type": "", "demo": "project\/update-variable.md", @@ -25238,7 +25301,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 143, + "weight": 132, "cookies": false, "type": "", "demo": "project\/delete-variable.md", @@ -25324,7 +25387,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\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "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. You may filter on the following attributes: name, teamId, labels, search", "required": false, "schema": { "type": "array", @@ -25382,7 +25445,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 92, + "weight": 81, "cookies": false, "type": "", "demo": "projects\/create.md", @@ -25449,7 +25512,8 @@ "url": { "type": "string", "description": "Project URL.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25517,7 +25581,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 93, + "weight": 82, "cookies": false, "type": "", "demo": "projects\/get.md", @@ -25576,7 +25640,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 94, + "weight": 83, "cookies": false, "type": "", "demo": "projects\/update.md", @@ -25635,7 +25699,8 @@ "url": { "type": "string", "description": "Project URL.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25692,7 +25757,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 111, + "weight": 100, "cookies": false, "type": "", "demo": "projects\/delete.md", @@ -25753,7 +25818,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 98, + "weight": 87, "cookies": false, "type": "", "demo": "projects\/update-api-status.md", @@ -25910,7 +25975,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 99, + "weight": 88, "cookies": false, "type": "", "demo": "projects\/update-api-status-all.md", @@ -26050,7 +26115,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 104, + "weight": 93, "cookies": false, "type": "", "demo": "projects\/update-auth-duration.md", @@ -26094,7 +26159,8 @@ "duration": { "type": "integer", "description": "Project session length in seconds. Max length: 31536000 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26130,7 +26196,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 103, + "weight": 92, "cookies": false, "type": "", "demo": "projects\/update-auth-limit.md", @@ -26174,7 +26240,8 @@ "limit": { "type": "integer", "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26210,7 +26277,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 109, + "weight": 98, "cookies": false, "type": "", "demo": "projects\/update-auth-sessions-limit.md", @@ -26254,7 +26321,8 @@ "limit": { "type": "integer", "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", - "x-example": 1 + "x-example": 1, + "format": "int32" } }, "required": [ @@ -26290,7 +26358,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 102, + "weight": 91, "cookies": false, "type": "", "demo": "projects\/update-memberships-privacy.md", @@ -26382,7 +26450,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 110, + "weight": 99, "cookies": false, "type": "", "demo": "projects\/update-mock-numbers.md", @@ -26465,7 +26533,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 107, + "weight": 96, "cookies": false, "type": "", "demo": "projects\/update-auth-password-dictionary.md", @@ -26545,7 +26613,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 106, + "weight": 95, "cookies": false, "type": "", "demo": "projects\/update-auth-password-history.md", @@ -26589,7 +26657,8 @@ "limit": { "type": "integer", "description": "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 is20. Default value is 0", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26625,7 +26694,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 108, + "weight": 97, "cookies": false, "type": "", "demo": "projects\/update-personal-data-check.md", @@ -26705,7 +26774,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 101, + "weight": 90, "cookies": false, "type": "", "demo": "projects\/update-session-alerts.md", @@ -26785,7 +26854,7 @@ "x-appwrite": { "method": "updateSessionInvalidation", "group": "auth", - "weight": 137, + "weight": 126, "cookies": false, "type": "", "demo": "projects\/update-session-invalidation.md", @@ -26865,7 +26934,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 105, + "weight": 94, "cookies": false, "type": "", "demo": "projects\/update-auth-status.md", @@ -27346,7 +27415,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 123, + "weight": 112, "cookies": false, "type": "", "demo": "projects\/create-jwt.md", @@ -27457,7 +27526,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -27493,7 +27563,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 119, + "weight": 108, "cookies": false, "type": "", "demo": "projects\/list-keys.md", @@ -27563,7 +27633,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 118, + "weight": 107, "cookies": false, "type": "", "demo": "projects\/create-key.md", @@ -27718,7 +27788,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 120, + "weight": 109, "cookies": false, "type": "", "demo": "projects\/get-key.md", @@ -27787,7 +27857,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 121, + "weight": 110, "cookies": false, "type": "", "demo": "projects\/update-key.md", @@ -27943,7 +28013,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 122, + "weight": 111, "cookies": false, "type": "", "demo": "projects\/delete-key.md", @@ -27990,6 +28060,88 @@ ] } }, + "\/projects\/{projectId}\/labels": { + "put": { + "summary": "Update project labels", + "operationId": "projectsUpdateLabels", + "tags": [ + "projects" + ], + "description": "Update the project labels by its unique ID. Labels can be used to easily filter projects in an organization.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "projects", + "weight": 435, + "cookies": false, + "type": "", + "demo": "projects\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, "\/projects\/{projectId}\/oauth2": { "patch": { "summary": "Update project OAuth2", @@ -28014,7 +28166,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 100, + "weight": 89, "cookies": false, "type": "", "demo": "projects\/update-o-auth-2.md", @@ -28098,9 +28250,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -28157,7 +28307,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 125, + "weight": 114, "cookies": false, "type": "", "demo": "projects\/list-platforms.md", @@ -28227,7 +28377,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 124, + "weight": 113, "cookies": false, "type": "", "demo": "projects\/create-platform.md", @@ -28347,7 +28497,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 126, + "weight": 115, "cookies": false, "type": "", "demo": "projects\/get-platform.md", @@ -28416,7 +28566,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 127, + "weight": 116, "cookies": false, "type": "", "demo": "projects\/update-platform.md", @@ -28512,7 +28662,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 128, + "weight": 117, "cookies": false, "type": "", "demo": "projects\/delete-platform.md", @@ -28583,7 +28733,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 96, + "weight": 85, "cookies": false, "type": "", "demo": "projects\/update-service-status.md", @@ -28686,7 +28836,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 97, + "weight": 86, "cookies": false, "type": "", "demo": "projects\/update-service-status-all.md", @@ -28766,7 +28916,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 129, + "weight": 118, "cookies": false, "type": "", "demo": "projects\/update-smtp.md", @@ -28896,12 +29046,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -28911,7 +29063,8 @@ "port": { "type": "integer", "description": "SMTP server port", - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -28961,7 +29114,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 130, + "weight": 119, "cookies": false, "type": "", "demo": "projects\/create-smtp-test.md", @@ -29098,12 +29251,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29113,7 +29268,8 @@ "port": { "type": "integer", "description": "SMTP server port", - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29173,7 +29329,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 95, + "weight": 84, "cookies": false, "type": "", "demo": "projects\/update-team.md", @@ -29253,7 +29409,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 132, + "weight": 121, "cookies": false, "type": "", "demo": "projects\/get-email-template.md", @@ -29478,7 +29634,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 134, + "weight": 123, "cookies": false, "type": "", "demo": "projects\/update-email-template.md", @@ -29703,12 +29859,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -29743,7 +29901,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 136, + "weight": 125, "cookies": false, "type": "", "demo": "projects\/delete-email-template.md", @@ -29970,7 +30128,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 131, + "weight": 120, "cookies": false, "type": "", "demo": "projects\/get-sms-template.md", @@ -30256,7 +30414,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 133, + "weight": 122, "cookies": false, "type": "", "demo": "projects\/update-sms-template.md", @@ -30565,7 +30723,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 135, + "weight": 124, "cookies": false, "type": "", "demo": "projects\/delete-sms-template.md", @@ -30853,7 +31011,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 113, + "weight": 102, "cookies": false, "type": "", "demo": "projects\/list-webhooks.md", @@ -30923,7 +31081,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 112, + "weight": 101, "cookies": false, "type": "", "demo": "projects\/create-webhook.md", @@ -31039,7 +31197,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 114, + "weight": 103, "cookies": false, "type": "", "demo": "projects\/get-webhook.md", @@ -31108,7 +31266,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 115, + "weight": 104, "cookies": false, "type": "", "demo": "projects\/update-webhook.md", @@ -31225,7 +31383,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 117, + "weight": 106, "cookies": false, "type": "", "demo": "projects\/delete-webhook.md", @@ -31296,7 +31454,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 116, + "weight": 105, "cookies": false, "type": "", "demo": "projects\/update-webhook-signature.md", @@ -31367,7 +31525,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 510, + "weight": 511, "cookies": false, "type": "", "demo": "proxy\/list-rules.md", @@ -31452,7 +31610,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 505, + "weight": 506, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -31519,7 +31677,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 507, + "weight": 508, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -31597,7 +31755,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 508, + "weight": 509, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -31633,7 +31791,8 @@ "url": { "type": "string", "description": "Target URL of redirection", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "statusCode": { "type": "string", @@ -31710,7 +31869,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 506, + "weight": 507, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -31788,7 +31947,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 509, + "weight": 510, "cookies": false, "type": "", "demo": "proxy\/get-rule.md", @@ -31839,7 +31998,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 511, + "weight": 512, "cookies": false, "type": "", "demo": "proxy\/delete-rule.md", @@ -31899,7 +32058,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 512, + "weight": 513, "cookies": false, "type": "", "demo": "proxy\/update-rule-verification.md", @@ -31959,7 +32118,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 467, + "weight": 468, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -32044,7 +32203,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 465, + "weight": 466, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -32121,7 +32280,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -32297,7 +32457,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 470, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -32347,7 +32507,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 493, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -32397,7 +32557,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 489, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -32526,7 +32686,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 490, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -32586,7 +32746,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 491, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -32658,7 +32818,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 466, + "weight": 467, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -32718,7 +32878,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 468, + "weight": 469, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -32802,7 +32962,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -32967,7 +33128,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 469, + "weight": 470, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -33029,7 +33190,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 476, + "weight": 477, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -33110,7 +33271,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 475, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -33205,7 +33366,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 471, + "weight": 472, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -33268,7 +33429,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -33310,7 +33472,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 479, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -33391,7 +33553,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 472, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -33508,7 +33670,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 473, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -33607,7 +33769,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 474, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -33670,7 +33832,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 477, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -33735,7 +33897,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 478, + "weight": 479, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -33826,7 +33988,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 480, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -33898,7 +34060,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 482, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -33984,7 +34146,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 481, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -34047,7 +34209,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 483, + "weight": 484, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -34119,7 +34281,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 492, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -34201,7 +34363,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 486, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -34261,7 +34423,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 484, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -34353,7 +34515,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 485, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -34423,7 +34585,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 487, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -34517,7 +34679,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 488, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -34589,7 +34751,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 520, + "weight": 521, "cookies": false, "type": "", "demo": "storage\/list-buckets.md", @@ -34675,7 +34837,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 518, + "weight": 519, "cookies": false, "type": "", "demo": "storage\/create-bucket.md", @@ -34738,7 +34900,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -34750,7 +34913,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "x-example": "none", "enum": [ "none", @@ -34810,7 +34973,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 519, + "weight": 520, "cookies": false, "type": "", "demo": "storage\/get-bucket.md", @@ -34871,7 +35034,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 521, + "weight": 522, "cookies": false, "type": "", "demo": "storage\/update-bucket.md", @@ -34941,7 +35104,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -34953,7 +35117,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "x-example": "none", "enum": [ "none", @@ -35003,7 +35167,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 522, + "weight": 523, "cookies": false, "type": "", "demo": "storage\/delete-bucket.md", @@ -35066,7 +35230,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -35165,7 +35329,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -35220,7 +35384,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -35266,7 +35431,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -35340,7 +35505,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -35432,7 +35597,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -35501,7 +35666,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -35581,7 +35746,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -35811,7 +35976,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -35898,7 +36063,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 532, + "weight": 533, "cookies": false, "type": "", "demo": "storage\/get-usage.md", @@ -35971,7 +36136,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 533, + "weight": 534, "cookies": false, "type": "", "demo": "storage\/get-bucket-usage.md", @@ -36331,7 +36496,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -38078,6 +38244,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -38194,6 +38361,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -38554,18 +38722,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -38682,18 +38853,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -38807,18 +38981,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -38935,18 +39112,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -40132,7 +40312,8 @@ "size": { "type": "integer", "description": "Column size for text columns, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -40271,6 +40452,7 @@ "type": "integer", "description": "Maximum size of the string column.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -40384,6 +40566,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -40500,6 +40683,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -42621,12 +42805,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42747,12 +42933,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -43000,7 +43188,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -43089,7 +43277,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -43176,7 +43364,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -43240,7 +43428,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -43316,7 +43504,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -43382,7 +43570,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 157, + "weight": 146, "cookies": false, "type": "", "demo": "teams\/list-logs.md", @@ -43467,7 +43655,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -43566,7 +43754,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -43615,7 +43803,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -43625,7 +43814,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -43645,7 +43835,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -43686,7 +43877,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -43760,7 +43951,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -43856,7 +44047,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -43932,7 +44123,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -44031,7 +44222,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -44093,7 +44284,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -44176,7 +44367,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 515, + "weight": 516, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -44270,7 +44461,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 513, + "weight": 514, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -44359,7 +44550,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 514, + "weight": 515, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -44419,7 +44610,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 516, + "weight": 517, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -44489,7 +44680,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 517, + "weight": 518, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44551,7 +44742,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -44637,7 +44828,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -44677,12 +44868,14 @@ "type": "string", "description": "User email.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -44729,7 +44922,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -44768,12 +44961,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44816,7 +45011,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -44855,12 +45050,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44903,7 +45100,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -44984,7 +45181,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -45047,7 +45244,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -45086,12 +45283,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45134,7 +45333,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -45173,12 +45372,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45221,7 +45422,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -45260,12 +45461,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45275,22 +45478,26 @@ "passwordCpu": { "type": "integer", "description": "Optional CPU cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -45338,7 +45545,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -45377,12 +45584,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45443,7 +45652,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -45482,12 +45691,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -45550,7 +45761,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 189, "cookies": false, "type": "", "demo": "users\/get-usage.md", @@ -45623,7 +45834,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -45677,7 +45888,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -45740,7 +45951,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -45786,7 +45997,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -45822,7 +46034,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -45873,7 +46085,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -45906,7 +46119,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -45991,7 +46204,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -46078,7 +46291,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -46176,7 +46389,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -46311,7 +46524,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -46447,7 +46660,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -46566,7 +46779,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -46683,7 +46896,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -46800,7 +47013,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -46919,7 +47132,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -47001,7 +47214,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -47083,7 +47296,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -47129,7 +47342,8 @@ "number": { "type": "string", "description": "User phone number.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -47165,7 +47379,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -47226,7 +47440,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -47308,7 +47522,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -47380,7 +47594,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -47434,7 +47648,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -47490,7 +47704,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -47563,7 +47777,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -47645,7 +47859,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -47730,7 +47944,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -47841,7 +48055,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -47912,7 +48126,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -48002,7 +48216,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -48075,7 +48289,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -48121,12 +48335,14 @@ "length": { "type": "integer", "description": "Token length in characters. The default length is 6 characters", - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -48159,7 +48375,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -48241,7 +48457,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -48323,7 +48539,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 204, + "weight": 193, "cookies": false, "type": "", "demo": "vcs\/create-repository-detection.md", @@ -48420,7 +48636,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 205, + "weight": 194, "cookies": false, "type": "", "demo": "vcs\/list-repositories.md", @@ -48519,7 +48735,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 206, + "weight": 195, "cookies": false, "type": "", "demo": "vcs\/create-repository.md", @@ -48605,7 +48821,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 207, + "weight": 196, "cookies": false, "type": "", "demo": "vcs\/get-repository.md", @@ -48676,7 +48892,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 208, + "weight": 197, "cookies": false, "type": "", "demo": "vcs\/list-repository-branches.md", @@ -48747,7 +48963,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 203, + "weight": 192, "cookies": false, "type": "", "demo": "vcs\/get-repository-contents.md", @@ -48833,7 +49049,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 213, + "weight": 202, "cookies": false, "type": "", "demo": "vcs\/update-external-deployments.md", @@ -48923,7 +49139,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 210, + "weight": 199, "cookies": false, "type": "", "demo": "vcs\/list-installations.md", @@ -49009,7 +49225,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 211, + "weight": 200, "cookies": false, "type": "", "demo": "vcs\/get-installation.md", @@ -49061,7 +49277,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 212, + "weight": 201, "cookies": false, "type": "", "demo": "vcs\/delete-installation.md", @@ -51029,14 +51245,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -52478,14 +52694,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -55069,7 +55285,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", "x-example": "gzip" }, "encryption": { @@ -55086,6 +55302,12 @@ "type": "boolean", "description": "Image transformations are enabled.", "x-example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "x-example": 128, + "format": "int32" } }, "required": [ @@ -55101,7 +55323,8 @@ "compression", "encryption", "antivirus", - "transformations" + "transformations", + "totalSize" ], "example": { "$id": "5e5ea5c16897e", @@ -55121,7 +55344,8 @@ "compression": "gzip", "encryption": false, "antivirus": false, - "transformations": false + "transformations": false, + "totalSize": 128 } }, "resourceToken": { @@ -57488,6 +57712,16 @@ "description": "Last ping datetime in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, + "labels": { + "type": "array", + "description": "Labels for the project.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -57632,6 +57866,7 @@ "smtpSecure", "pingCount", "pingedAt", + "labels", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -57700,6 +57935,9 @@ "smtpSecure": "tls", "pingCount": 1, "pingedAt": "2020-10-15T06:38:00.000+00:00", + "labels": [ + "vip" + ], "authEmailPassword": true, "authUsersAuthMagicURL": true, "authEmailOtp": true, @@ -59653,160 +59891,6 @@ "description": "Time range of the usage stats.", "x-example": "30d" }, - "deploymentsTotal": { - "type": "integer", - "description": "Total aggregated number of functions deployments.", - "x-example": 0, - "format": "int32" - }, - "deploymentsStorageTotal": { - "type": "integer", - "description": "Total aggregated sum of functions deployment storage.", - "x-example": 0, - "format": "int32" - }, - "buildsTotal": { - "type": "integer", - "description": "Total aggregated number of functions build.", - "x-example": 0, - "format": "int32" - }, - "buildsStorageTotal": { - "type": "integer", - "description": "total aggregated sum of functions build storage.", - "x-example": 0, - "format": "int32" - }, - "buildsTimeTotal": { - "type": "integer", - "description": "Total aggregated sum of functions build compute time.", - "x-example": 0, - "format": "int32" - }, - "buildsMbSecondsTotal": { - "type": "integer", - "description": "Total aggregated sum of functions build mbSeconds.", - "x-example": 0, - "format": "int32" - }, - "executionsTotal": { - "type": "integer", - "description": "Total aggregated number of functions execution.", - "x-example": 0, - "format": "int32" - }, - "executionsTimeTotal": { - "type": "integer", - "description": "Total aggregated sum of functions execution compute time.", - "x-example": 0, - "format": "int32" - }, - "executionsMbSecondsTotal": { - "type": "integer", - "description": "Total aggregated sum of functions execution mbSeconds.", - "x-example": 0, - "format": "int32" - }, - "deployments": { - "type": "array", - "description": "Aggregated number of functions deployment per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "deploymentsStorage": { - "type": "array", - "description": "Aggregated number of functions deployment storage per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsSuccessTotal": { - "type": "integer", - "description": "Total aggregated number of successful function builds.", - "x-example": 0, - "format": "int32" - }, - "buildsFailedTotal": { - "type": "integer", - "description": "Total aggregated number of failed function builds.", - "x-example": 0, - "format": "int32" - }, - "builds": { - "type": "array", - "description": "Aggregated number of functions build per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsStorage": { - "type": "array", - "description": "Aggregated sum of functions build storage per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsTime": { - "type": "array", - "description": "Aggregated sum of functions build compute time per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsMbSeconds": { - "type": "array", - "description": "Aggregated sum of functions build mbSeconds per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "executions": { - "type": "array", - "description": "Aggregated number of functions execution per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "executionsTime": { - "type": "array", - "description": "Aggregated number of functions execution compute time per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "executionsMbSeconds": { - "type": "array", - "description": "Aggregated number of functions mbSeconds per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsSuccess": { - "type": "array", - "description": "Aggregated number of successful function builds per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, - "buildsFailed": { - "type": "array", - "description": "Aggregated number of failed function builds per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": [] - }, "sitesTotal": { "type": "integer", "description": "Total aggregated number of sites.", @@ -59821,6 +59905,60 @@ }, "x-example": [] }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of sites deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of sites deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of sites build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of sites build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of sites build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of sites build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of sites execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of sites execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of sites execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, "requestsTotal": { "type": "integer", "description": "Total aggregated number of requests.", @@ -59862,10 +60000,112 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "deployments": { + "type": "array", + "description": "Aggregated number of sites deployment per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of sites deployment storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful site builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed site builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of sites build per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of sites build storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of sites build compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of sites build mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of sites execution per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of sites execution compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of sites mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful site builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed site builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ "range", + "sitesTotal", + "sites", "deploymentsTotal", "deploymentsStorageTotal", "buildsTotal", @@ -59875,6 +60115,12 @@ "executionsTotal", "executionsTimeTotal", "executionsMbSecondsTotal", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound", "deployments", "deploymentsStorage", "buildsSuccessTotal", @@ -59887,18 +60133,12 @@ "executionsTime", "executionsMbSeconds", "buildsSuccess", - "buildsFailed", - "sitesTotal", - "sites", - "requestsTotal", - "requests", - "inboundTotal", - "inbound", - "outboundTotal", - "outbound" + "buildsFailed" ], "example": { "range": "30d", + "sitesTotal": 0, + "sites": [], "deploymentsTotal": 0, "deploymentsStorageTotal": 0, "buildsTotal": 0, @@ -59908,6 +60148,12 @@ "executionsTotal": 0, "executionsTimeTotal": 0, "executionsMbSecondsTotal": 0, + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [], "deployments": [], "deploymentsStorage": [], "buildsSuccessTotal": 0, @@ -59920,15 +60166,7 @@ "executionsTime": [], "executionsMbSeconds": [], "buildsSuccess": [], - "buildsFailed": [], - "sitesTotal": 0, - "sites": [], - "requestsTotal": 0, - "requests": [], - "inboundTotal": 0, - "inbound": [], - "outboundTotal": 0, - "outbound": [] + "buildsFailed": [] } }, "usageSite": { @@ -61201,7 +61439,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -61247,7 +61485,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 2a0081b378..76e3a2a45c 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -142,7 +142,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -227,12 +228,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -445,7 +448,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -558,7 +562,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -631,7 +635,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -758,7 +762,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -901,7 +905,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1028,7 +1032,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1165,7 +1169,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1306,7 +1310,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1410,7 +1414,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1512,7 +1516,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1614,7 +1618,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1833,7 +1837,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1906,12 +1911,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2113,12 +2120,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2428,12 +2437,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -3001,7 +3012,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3088,12 +3100,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3203,9 +3217,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3321,7 +3333,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3449,7 +3462,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -3747,7 +3761,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -3877,7 +3891,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4013,7 +4027,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4075,7 +4089,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4567,7 +4581,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4653,7 +4667,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -4749,7 +4763,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -4845,7 +4859,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5948,7 +5962,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7721,6 +7736,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -7839,6 +7855,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8205,18 +8222,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8335,18 +8355,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8462,18 +8485,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -8592,18 +8618,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -9809,7 +9838,8 @@ "size": { "type": "integer", "description": "Attribute size for text attributes, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -9950,6 +9980,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10065,6 +10096,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10183,6 +10215,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -11774,12 +11807,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -11903,12 +11938,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12355,7 +12392,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -12441,7 +12478,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 435, + "weight": 436, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -12582,7 +12619,8 @@ "timeout": { "type": "integer", "description": "Function maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -12737,7 +12775,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -12788,7 +12826,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -12839,7 +12877,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 436, + "weight": 437, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -12900,7 +12938,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -13048,7 +13086,8 @@ "timeout": { "type": "integer", "description": "Maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13193,7 +13232,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -13256,7 +13295,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 444, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -13338,7 +13377,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 445, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -13434,7 +13473,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 442, + "weight": 443, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -13492,7 +13531,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -13534,7 +13574,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 450, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -13621,7 +13661,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 447, + "weight": 448, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -13739,7 +13779,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 448, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -13838,7 +13878,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 443, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -13902,7 +13942,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 446, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -13968,7 +14008,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 449, + "weight": 450, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -14060,7 +14100,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 451, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -14133,7 +14173,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -14222,7 +14262,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -14342,7 +14382,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -14410,7 +14450,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 455, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -14483,7 +14523,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 460, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -14544,7 +14584,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 458, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -14637,7 +14677,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 459, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -14708,7 +14748,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 461, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -14803,7 +14843,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 462, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -14876,7 +14916,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -14932,7 +14972,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -14988,7 +15028,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -15040,7 +15080,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -15092,7 +15132,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -15144,7 +15184,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -15207,7 +15247,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -15259,7 +15299,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -15311,7 +15351,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -15376,7 +15416,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -15441,7 +15481,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -15517,7 +15557,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -15582,7 +15622,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -15627,6 +15667,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -15673,7 +15714,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -15738,7 +15779,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -15803,7 +15844,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -15868,7 +15909,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -15933,7 +15974,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -15998,7 +16039,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -16063,7 +16104,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -16128,7 +16169,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -16193,7 +16234,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -16245,7 +16286,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -16297,7 +16338,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -16349,7 +16390,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -16405,7 +16446,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -16461,7 +16502,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -16517,7 +16558,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -16573,7 +16614,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -16629,7 +16670,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -16685,7 +16726,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -16741,7 +16782,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -16797,7 +16838,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -16886,7 +16927,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -17033,7 +17074,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -17192,7 +17233,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -17302,7 +17343,8 @@ "badge": { "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -17370,7 +17412,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -17499,6 +17541,7 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS platforms.", "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -17568,7 +17611,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -17752,7 +17795,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -17942,7 +17985,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -17997,7 +18040,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -18061,7 +18104,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -18149,7 +18192,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -18237,7 +18280,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -18326,7 +18369,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -18508,7 +18551,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -18692,7 +18735,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -18847,7 +18890,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -19003,7 +19046,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -19069,7 +19112,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19079,7 +19123,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19122,7 +19167,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -19201,7 +19246,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19244,7 +19290,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -19342,7 +19388,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -19443,7 +19489,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -19498,7 +19544,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19508,7 +19555,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19551,7 +19599,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -19619,7 +19667,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19662,7 +19711,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -19717,7 +19766,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19727,7 +19777,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19770,7 +19821,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -19838,7 +19889,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19881,7 +19933,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -20019,7 +20071,8 @@ "port": { "type": "integer", "description": "The default SMTP server port.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -20061,7 +20114,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20071,7 +20125,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20115,7 +20170,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -20257,6 +20312,7 @@ "type": "integer", "description": "SMTP port.", "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -20300,7 +20356,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20349,7 +20406,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -20394,7 +20451,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -20447,7 +20505,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -20548,7 +20606,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -20593,7 +20651,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -20646,7 +20705,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -20747,7 +20806,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -20792,7 +20851,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -20845,7 +20905,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -20946,7 +21006,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -20991,7 +21051,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -21044,7 +21105,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -21145,7 +21206,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -21200,7 +21261,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -21264,7 +21325,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -21352,7 +21413,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -21440,7 +21501,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -21527,7 +21588,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -21612,7 +21673,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -21674,7 +21735,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -21755,7 +21816,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -21819,7 +21880,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -21907,7 +21968,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -22004,7 +22065,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -22097,7 +22158,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -22162,7 +22223,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -22240,7 +22301,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 467, + "weight": 468, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -22326,7 +22387,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 465, + "weight": 466, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -22404,7 +22465,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -22580,7 +22642,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 470, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -22631,7 +22693,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 493, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -22682,7 +22744,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 466, + "weight": 467, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -22743,7 +22805,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 468, + "weight": 469, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -22828,7 +22890,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -22993,7 +23056,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 469, + "weight": 470, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -23056,7 +23119,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 476, + "weight": 477, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -23138,7 +23201,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 475, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -23234,7 +23297,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 471, + "weight": 472, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -23298,7 +23361,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -23340,7 +23404,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 479, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -23422,7 +23486,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 472, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -23540,7 +23604,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 473, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -23640,7 +23704,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 474, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -23704,7 +23768,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 477, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -23770,7 +23834,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 478, + "weight": 479, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -23862,7 +23926,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 480, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -23935,7 +23999,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 482, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -24022,7 +24086,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 481, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -24086,7 +24150,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 483, + "weight": 484, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -24159,7 +24223,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 486, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -24220,7 +24284,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 484, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -24313,7 +24377,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 485, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -24384,7 +24448,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 487, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -24479,7 +24543,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 488, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -24552,7 +24616,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 520, + "weight": 521, "cookies": false, "type": "", "demo": "storage\/list-buckets.md", @@ -24639,7 +24703,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 518, + "weight": 519, "cookies": false, "type": "", "demo": "storage\/create-bucket.md", @@ -24703,7 +24767,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -24715,7 +24780,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "x-example": "none", "enum": [ "none", @@ -24775,7 +24840,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 519, + "weight": 520, "cookies": false, "type": "", "demo": "storage\/get-bucket.md", @@ -24837,7 +24902,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 521, + "weight": 522, "cookies": false, "type": "", "demo": "storage\/update-bucket.md", @@ -24908,7 +24973,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -24920,7 +24986,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "x-example": "none", "enum": [ "none", @@ -24970,7 +25036,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 522, + "weight": 523, "cookies": false, "type": "", "demo": "storage\/delete-bucket.md", @@ -25034,7 +25100,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -25135,7 +25201,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -25192,7 +25258,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -25238,7 +25305,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -25314,7 +25381,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -25408,7 +25475,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -25479,7 +25546,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -25561,7 +25628,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -25793,7 +25860,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -26165,7 +26232,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -27835,6 +27903,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -27952,6 +28021,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -28315,18 +28385,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -28444,18 +28517,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -28570,18 +28646,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -28699,18 +28778,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -29906,7 +29988,8 @@ "size": { "type": "integer", "description": "Column size for text columns, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -30046,6 +30129,7 @@ "type": "integer", "description": "Maximum size of the string column.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -30160,6 +30244,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -30277,6 +30362,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -32242,12 +32328,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32370,12 +32458,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32415,7 +32505,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -32506,7 +32596,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -32595,7 +32685,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -32661,7 +32751,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -32739,7 +32829,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -32807,7 +32897,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -32908,7 +32998,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -32959,7 +33049,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -32969,7 +33060,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -32989,7 +33081,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -33030,7 +33123,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -33106,7 +33199,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -33204,7 +33297,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -33282,7 +33375,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -33383,7 +33476,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -33447,7 +33540,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -33532,7 +33625,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 515, + "weight": 516, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -33627,7 +33720,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 513, + "weight": 514, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -33717,7 +33810,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 514, + "weight": 515, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -33778,7 +33871,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 516, + "weight": 517, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -33849,7 +33942,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 517, + "weight": 518, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33912,7 +34005,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -33999,7 +34092,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -34040,12 +34133,14 @@ "type": "string", "description": "User email.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -34092,7 +34187,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -34132,12 +34227,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34180,7 +34277,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -34220,12 +34317,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34268,7 +34367,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -34350,7 +34449,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -34414,7 +34513,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -34454,12 +34553,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34502,7 +34603,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -34542,12 +34643,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34590,7 +34693,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -34630,12 +34733,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34645,22 +34750,26 @@ "passwordCpu": { "type": "integer", "description": "Optional CPU cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -34708,7 +34817,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -34748,12 +34857,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34814,7 +34925,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -34854,12 +34965,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -34922,7 +35035,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -34977,7 +35090,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -35041,7 +35154,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -35088,7 +35201,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -35124,7 +35238,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -35176,7 +35290,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -35209,7 +35324,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -35295,7 +35410,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -35383,7 +35498,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -35482,7 +35597,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -35620,7 +35735,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -35759,7 +35874,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -35881,7 +35996,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -36001,7 +36116,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -36121,7 +36236,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -36243,7 +36358,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -36326,7 +36441,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -36409,7 +36524,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -36456,7 +36571,8 @@ "number": { "type": "string", "description": "User phone number.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -36492,7 +36608,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -36554,7 +36670,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -36637,7 +36753,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -36710,7 +36826,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -36765,7 +36881,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -36822,7 +36938,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -36896,7 +37012,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -36979,7 +37095,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -37065,7 +37181,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -37177,7 +37293,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -37249,7 +37365,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -37340,7 +37456,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -37414,7 +37530,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -37461,12 +37577,14 @@ "length": { "type": "integer", "description": "Token length in characters. The default length is 6 characters", - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -37499,7 +37617,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -37582,7 +37700,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -39180,14 +39298,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -40629,14 +40747,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -43220,7 +43338,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", "x-example": "gzip" }, "encryption": { @@ -43237,6 +43355,12 @@ "type": "boolean", "description": "Image transformations are enabled.", "x-example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "x-example": 128, + "format": "int32" } }, "required": [ @@ -43252,7 +43376,8 @@ "compression", "encryption", "antivirus", - "transformations" + "transformations", + "totalSize" ], "example": { "$id": "5e5ea5c16897e", @@ -43272,7 +43397,8 @@ "compression": "gzip", "encryption": false, "antivirus": false, - "transformations": false + "transformations": false, + "totalSize": 128 } }, "resourceToken": { @@ -45288,7 +45414,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -45334,7 +45460,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index fd35c3b73c..6aef25072a 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -140,7 +140,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -224,12 +225,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -439,7 +442,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -551,7 +555,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -623,7 +627,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -747,7 +751,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -887,7 +891,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1011,7 +1015,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1145,7 +1149,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1283,7 +1287,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1384,7 +1388,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1483,7 +1487,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1582,7 +1586,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1796,7 +1800,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1868,12 +1873,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2072,12 +2079,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2382,12 +2391,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2573,9 +2584,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3304,7 +3313,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3390,12 +3400,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3504,9 +3516,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3621,7 +3631,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3746,7 +3757,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4039,7 +4051,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4167,7 +4179,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4301,7 +4313,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4361,7 +4373,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4851,7 +4863,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4935,7 +4947,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5029,7 +5041,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5123,7 +5135,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5980,7 +5992,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7146,12 +7159,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7273,12 +7288,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7598,7 +7615,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -7652,7 +7669,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -7706,7 +7723,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -7760,7 +7777,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -7814,7 +7831,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -7868,7 +7885,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -7922,7 +7939,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -7976,7 +7993,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -8030,7 +8047,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -8084,7 +8101,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -8138,7 +8155,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -8222,7 +8239,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -8452,7 +8469,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -9240,7 +9258,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -10403,12 +10422,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10529,12 +10550,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10574,7 +10597,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -10663,7 +10686,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -10750,7 +10773,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -10814,7 +10837,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -10890,7 +10913,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -10956,7 +10979,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -11055,7 +11078,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -11104,7 +11127,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -11114,7 +11138,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -11134,7 +11159,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -11175,7 +11201,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -11249,7 +11275,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -11345,7 +11371,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -11421,7 +11447,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -11521,7 +11547,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -11584,7 +11610,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -13428,6 +13454,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -13441,7 +13477,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -13456,7 +13494,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "team": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 952f83af6d..96c074b8ee 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -138,7 +138,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -261,12 +262,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -473,7 +476,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -584,7 +588,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -655,7 +659,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -778,7 +782,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -917,7 +921,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1040,7 +1044,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1173,7 +1177,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1310,7 +1314,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1410,7 +1414,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1508,7 +1512,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1606,7 +1610,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1817,7 +1821,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1888,12 +1893,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2089,12 +2096,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2394,12 +2403,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2583,9 +2594,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3304,7 +3313,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3389,12 +3399,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3502,9 +3514,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3618,7 +3628,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3742,7 +3753,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4032,7 +4044,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4160,7 +4172,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4294,7 +4306,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4354,7 +4366,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4844,7 +4856,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4928,7 +4940,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5022,7 +5034,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5116,7 +5128,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6387,7 +6399,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -8239,6 +8252,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -8356,6 +8370,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8719,18 +8734,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8848,18 +8866,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8974,18 +8995,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -9103,18 +9127,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -10310,7 +10337,8 @@ "size": { "type": "integer", "description": "Attribute size for text attributes, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -10450,6 +10478,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10564,6 +10593,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10681,6 +10711,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -12346,12 +12377,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12473,12 +12506,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -13556,7 +13591,8 @@ "timeout": { "type": "integer", "description": "Function maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14342,7 +14378,8 @@ "timeout": { "type": "integer", "description": "Maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14782,7 +14819,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -16229,7 +16267,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -16283,7 +16321,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -16337,7 +16375,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -16388,7 +16426,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -16439,7 +16477,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -16490,7 +16528,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -16552,7 +16590,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -16603,7 +16641,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -16654,7 +16692,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -16718,7 +16756,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -16782,7 +16820,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -16857,7 +16895,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -16921,7 +16959,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -16965,6 +17003,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -17011,7 +17050,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -17075,7 +17114,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -17139,7 +17178,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -17203,7 +17242,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -17267,7 +17306,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -17331,7 +17370,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -17395,7 +17434,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -17459,7 +17498,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -17523,7 +17562,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -17574,7 +17613,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -17625,7 +17664,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -17676,7 +17715,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -17730,7 +17769,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -17784,7 +17823,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -17838,7 +17877,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -17892,7 +17931,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -17946,7 +17985,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -18000,7 +18039,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -18054,7 +18093,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -18108,7 +18147,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -18196,7 +18235,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -18342,7 +18381,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -18500,7 +18539,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -18609,7 +18648,8 @@ "badge": { "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -18677,7 +18717,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -18805,6 +18845,7 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS platforms.", "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -18874,7 +18915,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -19055,7 +19096,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -19242,7 +19283,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -19296,7 +19337,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -19359,7 +19400,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -19446,7 +19487,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -19533,7 +19574,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -19621,7 +19662,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -19800,7 +19841,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -19981,7 +20022,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -20133,7 +20174,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -20286,7 +20327,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -20351,7 +20392,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20361,7 +20403,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20404,7 +20447,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -20482,7 +20525,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20525,7 +20569,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -20622,7 +20666,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -20722,7 +20766,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -20776,7 +20820,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20786,7 +20831,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20829,7 +20875,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -20896,7 +20942,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20939,7 +20986,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -20993,7 +21040,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21003,7 +21051,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21046,7 +21095,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -21113,7 +21162,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21156,7 +21206,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -21291,7 +21341,8 @@ "port": { "type": "integer", "description": "The default SMTP server port.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -21333,7 +21384,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21343,7 +21395,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21387,7 +21440,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -21526,6 +21579,7 @@ "type": "integer", "description": "SMTP port.", "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -21569,7 +21623,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21618,7 +21673,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -21662,7 +21717,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -21715,7 +21771,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -21815,7 +21871,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -21859,7 +21915,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -21912,7 +21969,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -22012,7 +22069,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -22056,7 +22113,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -22109,7 +22167,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -22209,7 +22267,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -22253,7 +22311,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -22306,7 +22365,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -22406,7 +22465,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -22460,7 +22519,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -22523,7 +22582,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -22610,7 +22669,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -22697,7 +22756,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -22783,7 +22842,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -22867,7 +22926,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -22928,7 +22987,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -23008,7 +23067,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -23071,7 +23130,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -23158,7 +23217,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -23254,7 +23313,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -23345,7 +23404,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -23409,7 +23468,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -23485,7 +23544,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 232, + "weight": 221, "cookies": false, "type": "", "demo": "migrations\/list.md", @@ -23571,7 +23630,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 226, + "weight": 215, "cookies": false, "type": "", "demo": "migrations\/create-appwrite-migration.md", @@ -23631,7 +23690,8 @@ "endpoint": { "type": "string", "description": "Source Appwrite endpoint", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "projectId": { "type": "string", @@ -23680,7 +23740,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 234, + "weight": 223, "cookies": false, "type": "", "demo": "migrations\/get-appwrite-report.md", @@ -23794,7 +23854,7 @@ "x-appwrite": { "method": "createCSVExport", "group": null, - "weight": 231, + "weight": 220, "cookies": false, "type": "", "demo": "migrations\/create-csv-export.md", @@ -23909,7 +23969,7 @@ "x-appwrite": { "method": "createCSVImport", "group": null, - "weight": 230, + "weight": 219, "cookies": false, "type": "", "demo": "migrations\/create-csv-import.md", @@ -23994,7 +24054,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 227, + "weight": 216, "cookies": false, "type": "", "demo": "migrations\/create-firebase-migration.md", @@ -24085,7 +24145,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 235, + "weight": 224, "cookies": false, "type": "", "demo": "migrations\/get-firebase-report.md", @@ -24172,7 +24232,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 229, + "weight": 218, "cookies": false, "type": "", "demo": "migrations\/create-n-host-migration.md", @@ -24257,7 +24317,8 @@ "port": { "type": "integer", "description": "Source's Database Port", - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24299,7 +24360,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 237, + "weight": 226, "cookies": false, "type": "", "demo": "migrations\/get-n-host-report.md", @@ -24448,7 +24509,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 228, + "weight": 217, "cookies": false, "type": "", "demo": "migrations\/create-supabase-migration.md", @@ -24503,7 +24564,8 @@ "endpoint": { "type": "string", "description": "Source's Supabase Endpoint", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "apiKey": { "type": "string", @@ -24528,7 +24590,8 @@ "port": { "type": "integer", "description": "Source's Database Port", - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24569,7 +24632,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 236, + "weight": 225, "cookies": false, "type": "", "demo": "migrations\/get-supabase-report.md", @@ -24709,7 +24772,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 233, + "weight": 222, "cookies": false, "type": "", "demo": "migrations\/get.md", @@ -24768,7 +24831,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 238, + "weight": 227, "cookies": false, "type": "", "demo": "migrations\/retry.md", @@ -24820,7 +24883,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 239, + "weight": 228, "cookies": false, "type": "", "demo": "migrations\/delete.md", @@ -24881,7 +24944,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 138, + "weight": 127, "cookies": false, "type": "", "demo": "project\/get-usage.md", @@ -24970,7 +25033,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 140, + "weight": 129, "cookies": false, "type": "", "demo": "project\/list-variables.md", @@ -25017,7 +25080,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 139, + "weight": 128, "cookies": false, "type": "", "demo": "project\/create-variable.md", @@ -25096,7 +25159,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 141, + "weight": 130, "cookies": false, "type": "", "demo": "project\/get-variable.md", @@ -25155,7 +25218,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 142, + "weight": 131, "cookies": false, "type": "", "demo": "project\/update-variable.md", @@ -25238,7 +25301,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 143, + "weight": 132, "cookies": false, "type": "", "demo": "project\/delete-variable.md", @@ -25324,7 +25387,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\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels", + "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. You may filter on the following attributes: name, teamId, labels, search", "required": false, "schema": { "type": "array", @@ -25382,7 +25445,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 92, + "weight": 81, "cookies": false, "type": "", "demo": "projects\/create.md", @@ -25449,7 +25512,8 @@ "url": { "type": "string", "description": "Project URL.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25517,7 +25581,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 93, + "weight": 82, "cookies": false, "type": "", "demo": "projects\/get.md", @@ -25576,7 +25640,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 94, + "weight": 83, "cookies": false, "type": "", "demo": "projects\/update.md", @@ -25635,7 +25699,8 @@ "url": { "type": "string", "description": "Project URL.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25692,7 +25757,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 111, + "weight": 100, "cookies": false, "type": "", "demo": "projects\/delete.md", @@ -25753,7 +25818,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 98, + "weight": 87, "cookies": false, "type": "", "demo": "projects\/update-api-status.md", @@ -25910,7 +25975,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 99, + "weight": 88, "cookies": false, "type": "", "demo": "projects\/update-api-status-all.md", @@ -26050,7 +26115,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 104, + "weight": 93, "cookies": false, "type": "", "demo": "projects\/update-auth-duration.md", @@ -26094,7 +26159,8 @@ "duration": { "type": "integer", "description": "Project session length in seconds. Max length: 31536000 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26130,7 +26196,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 103, + "weight": 92, "cookies": false, "type": "", "demo": "projects\/update-auth-limit.md", @@ -26174,7 +26240,8 @@ "limit": { "type": "integer", "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26210,7 +26277,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 109, + "weight": 98, "cookies": false, "type": "", "demo": "projects\/update-auth-sessions-limit.md", @@ -26254,7 +26321,8 @@ "limit": { "type": "integer", "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", - "x-example": 1 + "x-example": 1, + "format": "int32" } }, "required": [ @@ -26290,7 +26358,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 102, + "weight": 91, "cookies": false, "type": "", "demo": "projects\/update-memberships-privacy.md", @@ -26382,7 +26450,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 110, + "weight": 99, "cookies": false, "type": "", "demo": "projects\/update-mock-numbers.md", @@ -26465,7 +26533,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 107, + "weight": 96, "cookies": false, "type": "", "demo": "projects\/update-auth-password-dictionary.md", @@ -26545,7 +26613,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 106, + "weight": 95, "cookies": false, "type": "", "demo": "projects\/update-auth-password-history.md", @@ -26589,7 +26657,8 @@ "limit": { "type": "integer", "description": "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 is20. Default value is 0", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26625,7 +26694,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 108, + "weight": 97, "cookies": false, "type": "", "demo": "projects\/update-personal-data-check.md", @@ -26705,7 +26774,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 101, + "weight": 90, "cookies": false, "type": "", "demo": "projects\/update-session-alerts.md", @@ -26785,7 +26854,7 @@ "x-appwrite": { "method": "updateSessionInvalidation", "group": "auth", - "weight": 137, + "weight": 126, "cookies": false, "type": "", "demo": "projects\/update-session-invalidation.md", @@ -26865,7 +26934,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 105, + "weight": 94, "cookies": false, "type": "", "demo": "projects\/update-auth-status.md", @@ -27346,7 +27415,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 123, + "weight": 112, "cookies": false, "type": "", "demo": "projects\/create-jwt.md", @@ -27457,7 +27526,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -27493,7 +27563,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 119, + "weight": 108, "cookies": false, "type": "", "demo": "projects\/list-keys.md", @@ -27563,7 +27633,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 118, + "weight": 107, "cookies": false, "type": "", "demo": "projects\/create-key.md", @@ -27718,7 +27788,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 120, + "weight": 109, "cookies": false, "type": "", "demo": "projects\/get-key.md", @@ -27787,7 +27857,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 121, + "weight": 110, "cookies": false, "type": "", "demo": "projects\/update-key.md", @@ -27943,7 +28013,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 122, + "weight": 111, "cookies": false, "type": "", "demo": "projects\/delete-key.md", @@ -28096,7 +28166,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 100, + "weight": 89, "cookies": false, "type": "", "demo": "projects\/update-o-auth-2.md", @@ -28180,9 +28250,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -28239,7 +28307,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 125, + "weight": 114, "cookies": false, "type": "", "demo": "projects\/list-platforms.md", @@ -28309,7 +28377,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 124, + "weight": 113, "cookies": false, "type": "", "demo": "projects\/create-platform.md", @@ -28429,7 +28497,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 126, + "weight": 115, "cookies": false, "type": "", "demo": "projects\/get-platform.md", @@ -28498,7 +28566,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 127, + "weight": 116, "cookies": false, "type": "", "demo": "projects\/update-platform.md", @@ -28594,7 +28662,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 128, + "weight": 117, "cookies": false, "type": "", "demo": "projects\/delete-platform.md", @@ -28665,7 +28733,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 96, + "weight": 85, "cookies": false, "type": "", "demo": "projects\/update-service-status.md", @@ -28768,7 +28836,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 97, + "weight": 86, "cookies": false, "type": "", "demo": "projects\/update-service-status-all.md", @@ -28848,7 +28916,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 129, + "weight": 118, "cookies": false, "type": "", "demo": "projects\/update-smtp.md", @@ -28978,12 +29046,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -28993,7 +29063,8 @@ "port": { "type": "integer", "description": "SMTP server port", - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29043,7 +29114,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 130, + "weight": 119, "cookies": false, "type": "", "demo": "projects\/create-smtp-test.md", @@ -29180,12 +29251,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29195,7 +29268,8 @@ "port": { "type": "integer", "description": "SMTP server port", - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29255,7 +29329,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 95, + "weight": 84, "cookies": false, "type": "", "demo": "projects\/update-team.md", @@ -29335,7 +29409,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 132, + "weight": 121, "cookies": false, "type": "", "demo": "projects\/get-email-template.md", @@ -29560,7 +29634,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 134, + "weight": 123, "cookies": false, "type": "", "demo": "projects\/update-email-template.md", @@ -29785,12 +29859,14 @@ "senderEmail": { "type": "string", "description": "Email of the sender", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -29825,7 +29901,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 136, + "weight": 125, "cookies": false, "type": "", "demo": "projects\/delete-email-template.md", @@ -30052,7 +30128,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 131, + "weight": 120, "cookies": false, "type": "", "demo": "projects\/get-sms-template.md", @@ -30338,7 +30414,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 133, + "weight": 122, "cookies": false, "type": "", "demo": "projects\/update-sms-template.md", @@ -30647,7 +30723,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 135, + "weight": 124, "cookies": false, "type": "", "demo": "projects\/delete-sms-template.md", @@ -30935,7 +31011,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 113, + "weight": 102, "cookies": false, "type": "", "demo": "projects\/list-webhooks.md", @@ -31005,7 +31081,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 112, + "weight": 101, "cookies": false, "type": "", "demo": "projects\/create-webhook.md", @@ -31121,7 +31197,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 114, + "weight": 103, "cookies": false, "type": "", "demo": "projects\/get-webhook.md", @@ -31190,7 +31266,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 115, + "weight": 104, "cookies": false, "type": "", "demo": "projects\/update-webhook.md", @@ -31307,7 +31383,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 117, + "weight": 106, "cookies": false, "type": "", "demo": "projects\/delete-webhook.md", @@ -31378,7 +31454,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 116, + "weight": 105, "cookies": false, "type": "", "demo": "projects\/update-webhook-signature.md", @@ -31715,7 +31791,8 @@ "url": { "type": "string", "description": "Target URL of redirection", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "statusCode": { "type": "string", @@ -32203,7 +32280,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -32884,7 +32962,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -33350,7 +33429,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -34820,7 +34900,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -35023,7 +35104,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -35302,7 +35384,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -36413,7 +36496,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -38160,6 +38244,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -38276,6 +38361,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -38636,18 +38722,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -38764,18 +38853,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -38889,18 +38981,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -39017,18 +39112,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -40214,7 +40312,8 @@ "size": { "type": "integer", "description": "Column size for text columns, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -40353,6 +40452,7 @@ "type": "integer", "description": "Maximum size of the string column.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -40466,6 +40566,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -40582,6 +40683,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -42703,12 +42805,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42829,12 +42933,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -43082,7 +43188,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -43171,7 +43277,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -43258,7 +43364,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -43322,7 +43428,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -43398,7 +43504,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -43464,7 +43570,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 157, + "weight": 146, "cookies": false, "type": "", "demo": "teams\/list-logs.md", @@ -43549,7 +43655,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -43648,7 +43754,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -43697,7 +43803,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -43707,7 +43814,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -43727,7 +43835,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -43768,7 +43877,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -43842,7 +43951,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -43938,7 +44047,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -44014,7 +44123,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -44113,7 +44222,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -44175,7 +44284,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -44633,7 +44742,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -44719,7 +44828,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -44759,12 +44868,14 @@ "type": "string", "description": "User email.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -44811,7 +44922,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -44850,12 +44961,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44898,7 +45011,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -44937,12 +45050,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44985,7 +45100,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -45066,7 +45181,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -45129,7 +45244,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -45168,12 +45283,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45216,7 +45333,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -45255,12 +45372,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45303,7 +45422,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -45342,12 +45461,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45357,22 +45478,26 @@ "passwordCpu": { "type": "integer", "description": "Optional CPU cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -45420,7 +45545,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -45459,12 +45584,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45525,7 +45652,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -45564,12 +45691,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -45632,7 +45761,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 189, "cookies": false, "type": "", "demo": "users\/get-usage.md", @@ -45705,7 +45834,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -45759,7 +45888,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -45822,7 +45951,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -45868,7 +45997,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -45904,7 +46034,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -45955,7 +46085,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -45988,7 +46119,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -46073,7 +46204,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -46160,7 +46291,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -46258,7 +46389,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -46393,7 +46524,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -46529,7 +46660,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -46648,7 +46779,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -46765,7 +46896,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -46882,7 +47013,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -47001,7 +47132,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -47083,7 +47214,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -47165,7 +47296,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -47211,7 +47342,8 @@ "number": { "type": "string", "description": "User phone number.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -47247,7 +47379,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -47308,7 +47440,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -47390,7 +47522,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -47462,7 +47594,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -47516,7 +47648,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -47572,7 +47704,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -47645,7 +47777,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -47727,7 +47859,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -47812,7 +47944,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -47923,7 +48055,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -47994,7 +48126,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -48084,7 +48216,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -48157,7 +48289,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -48203,12 +48335,14 @@ "length": { "type": "integer", "description": "Token length in characters. The default length is 6 characters", - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -48241,7 +48375,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -48323,7 +48457,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -48405,7 +48539,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 204, + "weight": 193, "cookies": false, "type": "", "demo": "vcs\/create-repository-detection.md", @@ -48502,7 +48636,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 205, + "weight": 194, "cookies": false, "type": "", "demo": "vcs\/list-repositories.md", @@ -48601,7 +48735,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 206, + "weight": 195, "cookies": false, "type": "", "demo": "vcs\/create-repository.md", @@ -48687,7 +48821,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 207, + "weight": 196, "cookies": false, "type": "", "demo": "vcs\/get-repository.md", @@ -48758,7 +48892,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 208, + "weight": 197, "cookies": false, "type": "", "demo": "vcs\/list-repository-branches.md", @@ -48829,7 +48963,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 203, + "weight": 192, "cookies": false, "type": "", "demo": "vcs\/get-repository-contents.md", @@ -48915,7 +49049,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 213, + "weight": 202, "cookies": false, "type": "", "demo": "vcs\/update-external-deployments.md", @@ -49005,7 +49139,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 210, + "weight": 199, "cookies": false, "type": "", "demo": "vcs\/list-installations.md", @@ -49091,7 +49225,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 211, + "weight": 200, "cookies": false, "type": "", "demo": "vcs\/get-installation.md", @@ -49143,7 +49277,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 212, + "weight": 201, "cookies": false, "type": "", "demo": "vcs\/delete-installation.md", @@ -51111,14 +51245,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -52560,14 +52694,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -55057,6 +55191,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -55070,7 +55214,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -55085,7 +55231,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "bucket": { @@ -61305,7 +61453,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -61351,7 +61499,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 70e8b895ce..d86aa78f99 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -142,7 +142,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -227,12 +228,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -445,7 +448,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -558,7 +562,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -631,7 +635,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -758,7 +762,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -901,7 +905,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1028,7 +1032,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1165,7 +1169,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1306,7 +1310,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1410,7 +1414,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1512,7 +1516,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1614,7 +1618,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1833,7 +1837,8 @@ "oldPassword": { "type": "string", "description": "Current user password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1906,12 +1911,14 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2113,12 +2120,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2428,12 +2437,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -3001,7 +3012,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3088,12 +3100,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3203,9 +3217,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -3321,7 +3333,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3449,7 +3462,8 @@ "url": { "type": "string", "description": "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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -3747,7 +3761,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -3877,7 +3891,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4013,7 +4027,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4075,7 +4089,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4567,7 +4581,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4653,7 +4667,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -4749,7 +4763,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -4845,7 +4859,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5948,7 +5962,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7721,6 +7736,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -7839,6 +7855,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8205,18 +8222,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8335,18 +8355,21 @@ "type": "number", "description": "Minimum value.", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value.", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8462,18 +8485,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -8592,18 +8618,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when attribute is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -9809,7 +9838,8 @@ "size": { "type": "integer", "description": "Attribute size for text attributes, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -9950,6 +9980,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10065,6 +10096,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10183,6 +10215,7 @@ "type": "string", "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -11774,12 +11807,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -11903,12 +11938,14 @@ "value": { "type": "number", "description": "Value to increment the attribute by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12582,7 +12619,8 @@ "timeout": { "type": "integer", "description": "Function maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13048,7 +13086,8 @@ "timeout": { "type": "integer", "description": "Maximum execution time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13492,7 +13531,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -14876,7 +14916,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -14932,7 +14972,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -14988,7 +15028,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -15040,7 +15080,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -15092,7 +15132,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -15144,7 +15184,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -15207,7 +15247,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -15259,7 +15299,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -15311,7 +15351,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -15376,7 +15416,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -15441,7 +15481,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -15517,7 +15557,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -15582,7 +15622,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -15627,6 +15667,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -15673,7 +15714,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -15738,7 +15779,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -15803,7 +15844,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -15868,7 +15909,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -15933,7 +15974,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -15998,7 +16039,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -16063,7 +16104,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -16128,7 +16169,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -16193,7 +16234,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -16245,7 +16286,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -16297,7 +16338,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -16349,7 +16390,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -16405,7 +16446,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -16461,7 +16502,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -16517,7 +16558,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -16573,7 +16614,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -16629,7 +16670,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -16685,7 +16726,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -16741,7 +16782,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -16797,7 +16838,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -16886,7 +16927,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -17033,7 +17074,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -17192,7 +17233,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -17302,7 +17343,8 @@ "badge": { "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -17370,7 +17412,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -17499,6 +17541,7 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS platforms.", "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -17568,7 +17611,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -17752,7 +17795,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -17942,7 +17985,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -17997,7 +18040,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -18061,7 +18104,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -18149,7 +18192,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -18237,7 +18280,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -18326,7 +18369,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -18508,7 +18551,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -18692,7 +18735,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -18847,7 +18890,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -19003,7 +19046,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -19069,7 +19112,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19079,7 +19123,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19122,7 +19167,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -19201,7 +19246,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19244,7 +19290,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -19342,7 +19388,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -19443,7 +19489,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -19498,7 +19544,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19508,7 +19555,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19551,7 +19599,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -19619,7 +19667,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19662,7 +19711,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -19717,7 +19766,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19727,7 +19777,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19770,7 +19821,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -19838,7 +19889,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19881,7 +19933,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -20019,7 +20071,8 @@ "port": { "type": "integer", "description": "The default SMTP server port.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -20061,7 +20114,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20071,7 +20125,8 @@ "replyToEmail": { "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20115,7 +20170,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -20257,6 +20312,7 @@ "type": "integer", "description": "SMTP port.", "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -20300,7 +20356,8 @@ "fromEmail": { "type": "string", "description": "Sender email address.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20349,7 +20406,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -20394,7 +20451,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -20447,7 +20505,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -20548,7 +20606,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -20593,7 +20651,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -20646,7 +20705,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -20747,7 +20806,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -20792,7 +20851,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -20845,7 +20905,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -20946,7 +21006,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -20991,7 +21051,8 @@ "from": { "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -21044,7 +21105,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -21145,7 +21206,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -21200,7 +21261,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -21264,7 +21325,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -21352,7 +21413,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -21440,7 +21501,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -21527,7 +21588,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -21612,7 +21673,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -21674,7 +21735,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -21755,7 +21816,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -21819,7 +21880,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -21907,7 +21968,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -22004,7 +22065,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -22097,7 +22158,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -22162,7 +22223,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -22404,7 +22465,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -22828,7 +22890,8 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -23298,7 +23361,8 @@ "code": { "type": "string", "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", - "x-example": null + "x-example": null, + "format": "binary" }, "activate": { "type": "boolean", @@ -24703,7 +24767,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -24908,7 +24973,8 @@ "maximumFileSize": { "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -25192,7 +25258,8 @@ "file": { "type": "string", "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", - "x-example": null + "x-example": null, + "format": "binary" }, "permissions": { "type": "array", @@ -26165,7 +26232,8 @@ "ttl": { "type": "integer", "description": "Seconds before the transaction expires.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -27835,6 +27903,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -27952,6 +28021,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -28315,18 +28385,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -28444,18 +28517,21 @@ "type": "number", "description": "Minimum value", "x-example": null, + "format": "float", "x-nullable": true }, "max": { "type": "number", "description": "Maximum value", "x-example": null, + "format": "float", "x-nullable": true }, "default": { "type": "number", "description": "Default value. Cannot be set when required.", "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -28570,18 +28646,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -28699,18 +28778,21 @@ "type": "integer", "description": "Minimum value", "x-example": null, + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value", "x-example": null, + "format": "int64", "x-nullable": true }, "default": { "type": "integer", "description": "Default value. Cannot be set when column is required.", "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -29906,7 +29988,8 @@ "size": { "type": "integer", "description": "Column size for text columns, in number of characters.", - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -30046,6 +30129,7 @@ "type": "integer", "description": "Maximum size of the string column.", "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -30160,6 +30244,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -30277,6 +30362,7 @@ "type": "string", "description": "Default value for column when not provided. Cannot be set when column is required.", "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -32242,12 +32328,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32370,12 +32458,14 @@ "value": { "type": "number", "description": "Value to increment the column by. The value must be a number.", - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32415,7 +32505,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -32506,7 +32596,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -32595,7 +32685,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -32661,7 +32751,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -32739,7 +32829,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -32807,7 +32897,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -32908,7 +32998,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -32959,7 +33049,8 @@ "email": { "type": "string", "description": "Email of the new team member.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -32969,7 +33060,8 @@ "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -32989,7 +33081,8 @@ "url": { "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -33030,7 +33123,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -33106,7 +33199,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -33204,7 +33297,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -33282,7 +33375,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -33383,7 +33476,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -33447,7 +33540,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -33912,7 +34005,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -33999,7 +34092,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -34040,12 +34133,14 @@ "type": "string", "description": "User email.", "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -34092,7 +34187,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -34132,12 +34227,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34180,7 +34277,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -34220,12 +34317,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34268,7 +34367,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -34350,7 +34449,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -34414,7 +34513,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -34454,12 +34553,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34502,7 +34603,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -34542,12 +34643,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34590,7 +34693,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -34630,12 +34733,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34645,22 +34750,26 @@ "passwordCpu": { "type": "integer", "description": "Optional CPU cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -34708,7 +34817,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -34748,12 +34857,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34814,7 +34925,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -34854,12 +34965,14 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -34922,7 +35035,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -34977,7 +35090,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -35041,7 +35154,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -35088,7 +35201,8 @@ "email": { "type": "string", "description": "User email.", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -35124,7 +35238,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -35176,7 +35290,8 @@ "duration": { "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -35209,7 +35324,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -35295,7 +35410,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -35383,7 +35498,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -35482,7 +35597,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -35620,7 +35735,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -35759,7 +35874,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -35881,7 +35996,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -36001,7 +36116,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -36121,7 +36236,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -36243,7 +36358,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -36326,7 +36441,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -36409,7 +36524,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -36456,7 +36571,8 @@ "number": { "type": "string", "description": "User phone number.", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -36492,7 +36608,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -36554,7 +36670,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -36637,7 +36753,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -36710,7 +36826,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -36765,7 +36881,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -36822,7 +36938,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -36896,7 +37012,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -36979,7 +37095,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -37065,7 +37181,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -37177,7 +37293,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -37249,7 +37365,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -37340,7 +37456,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -37414,7 +37530,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -37461,12 +37577,14 @@ "length": { "type": "integer", "description": "Token length in characters. The default length is 6 characters", - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -37499,7 +37617,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -37582,7 +37700,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -39180,14 +39298,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -40629,14 +40747,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "nullable": true }, "default": { @@ -43126,6 +43244,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -43139,7 +43267,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -43154,7 +43284,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "bucket": { @@ -45296,7 +45428,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -45342,7 +45474,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json index e11d5053a4..1d02df124a 100644 --- a/app/config/specs/swagger2-1.8.x-client.json +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -191,7 +191,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -280,13 +281,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -498,7 +501,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -608,7 +612,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -683,7 +687,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -807,7 +811,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -948,7 +952,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1072,7 +1076,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1209,7 +1213,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1349,7 +1353,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1450,7 +1454,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1551,7 +1555,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1652,7 +1656,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1874,7 +1878,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1949,13 +1954,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2160,13 +2167,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2485,13 +2494,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2683,9 +2694,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3429,7 +3438,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3520,13 +3530,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3638,9 +3650,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3754,7 +3764,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3882,7 +3893,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4191,7 +4203,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4317,7 +4329,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4449,7 +4461,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4513,7 +4525,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -5001,7 +5013,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -5085,7 +5097,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5177,7 +5189,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5269,7 +5281,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6087,7 +6099,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7208,13 +7221,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7329,13 +7344,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7375,7 +7392,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -7458,7 +7475,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -7577,7 +7594,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -7649,7 +7666,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -7724,7 +7741,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -7797,7 +7814,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -7850,7 +7867,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -7903,7 +7920,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -7956,7 +7973,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -8009,7 +8026,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -8062,7 +8079,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -8115,7 +8132,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -8168,7 +8185,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -8223,7 +8240,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -8308,7 +8325,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -8379,7 +8396,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -8472,7 +8489,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -8563,7 +8580,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -8634,7 +8651,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -8725,7 +8742,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -8796,7 +8813,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -8876,7 +8893,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -9084,7 +9101,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -9275,7 +9292,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -10393,13 +10411,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10513,13 +10533,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10559,7 +10581,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -10644,7 +10666,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -10735,7 +10757,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -10798,7 +10820,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -10874,7 +10896,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -10937,7 +10959,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -11030,7 +11052,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -11076,7 +11098,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -11088,7 +11111,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -11110,7 +11134,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -11151,7 +11176,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -11222,7 +11247,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -11316,7 +11341,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -11389,7 +11414,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -11485,7 +11510,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -11548,7 +11573,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 21f8513e16..17064287be 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -201,7 +201,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -333,13 +334,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -548,7 +551,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -657,7 +661,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -731,7 +735,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -854,7 +858,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -994,7 +998,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1117,7 +1121,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1253,7 +1257,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1392,7 +1396,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1492,7 +1496,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1592,7 +1596,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1692,7 +1696,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1911,7 +1915,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1985,13 +1990,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2193,13 +2200,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2513,13 +2522,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2709,9 +2720,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3445,7 +3454,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3535,13 +3545,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3652,9 +3664,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3767,7 +3777,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3894,7 +3905,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4200,7 +4212,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4326,7 +4338,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4458,7 +4470,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4522,7 +4534,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -5010,7 +5022,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -5094,7 +5106,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5186,7 +5198,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5278,7 +5290,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -5993,7 +6005,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 495, + "weight": 496, "cookies": false, "type": "", "demo": "assistant\/chat.md", @@ -6057,7 +6069,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 496, + "weight": 497, "cookies": false, "type": "", "demo": "console\/get-resource.md", @@ -6128,7 +6140,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 494, + "weight": 495, "cookies": false, "type": "", "demo": "console\/variables.md", @@ -6518,7 +6530,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -8343,6 +8356,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -8457,6 +8471,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8819,6 +8834,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8826,6 +8842,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8833,6 +8850,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8947,6 +8965,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8954,6 +8973,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8961,6 +8981,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -9075,6 +9096,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -9082,6 +9104,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -9089,6 +9112,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -9203,6 +9227,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -9210,6 +9235,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -9217,6 +9243,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -10356,7 +10383,8 @@ "type": "integer", "description": "Attribute size for text attributes, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -10497,6 +10525,7 @@ "description": "Maximum size of the string attribute.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10611,6 +10640,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10725,6 +10755,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -12327,13 +12358,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12448,13 +12481,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -13275,7 +13310,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -13357,7 +13392,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 435, + "weight": 436, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -13505,7 +13540,8 @@ "type": "integer", "description": "Function maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13670,7 +13706,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -13720,7 +13756,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -13770,7 +13806,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 464, + "weight": 465, "cookies": false, "type": "", "demo": "functions\/list-templates.md", @@ -13954,7 +13990,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 463, + "weight": 464, "cookies": false, "type": "", "demo": "functions\/get-template.md", @@ -14012,7 +14048,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 457, + "weight": 458, "cookies": false, "type": "", "demo": "functions\/list-usage.md", @@ -14082,7 +14118,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 436, + "weight": 437, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -14142,7 +14178,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -14292,7 +14328,8 @@ "type": "integer", "description": "Maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14451,7 +14488,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -14513,7 +14550,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 444, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -14591,7 +14628,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 445, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -14681,7 +14718,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 442, + "weight": 443, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -14774,7 +14811,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 450, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -14860,7 +14897,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 447, + "weight": 448, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -14981,7 +15018,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 448, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -15078,7 +15115,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 443, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -15141,7 +15178,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 446, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -15209,7 +15246,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 449, + "weight": 450, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -15295,7 +15332,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 451, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -15363,7 +15400,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -15446,7 +15483,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -15565,7 +15602,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -15630,7 +15667,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 455, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -15698,7 +15735,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 456, + "weight": 457, "cookies": false, "type": "", "demo": "functions\/get-usage.md", @@ -15776,7 +15813,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 460, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -15836,7 +15873,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 458, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -15927,7 +15964,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 459, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -15995,7 +16032,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 461, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -16090,7 +16127,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 462, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -16160,7 +16197,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -16235,7 +16272,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -16308,7 +16345,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -16359,7 +16396,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -16410,7 +16447,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -16461,7 +16498,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -16521,7 +16558,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -16572,7 +16609,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -16623,7 +16660,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -16685,7 +16722,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -16747,7 +16784,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -16818,7 +16855,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -16880,7 +16917,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -16923,6 +16960,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -16966,7 +17004,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -17028,7 +17066,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -17090,7 +17128,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -17152,7 +17190,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -17214,7 +17252,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -17276,7 +17314,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -17338,7 +17376,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -17400,7 +17438,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -17462,7 +17500,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -17513,7 +17551,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -17564,7 +17602,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -17615,7 +17653,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -17668,7 +17706,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -17721,7 +17759,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -17774,7 +17812,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -17827,7 +17865,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -17880,7 +17918,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -17933,7 +17971,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -17986,7 +18024,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -18039,7 +18077,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -18124,7 +18162,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -18284,7 +18322,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -18451,7 +18489,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -18575,7 +18613,8 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", "default": -1, - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -18649,7 +18688,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -18787,6 +18826,7 @@ "description": "Badge for push notification. Available only for iOS platforms.", "default": null, "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -18862,7 +18902,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -19052,7 +19092,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -19241,7 +19281,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -19297,7 +19337,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -19358,7 +19398,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -19440,7 +19480,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -19522,7 +19562,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -19607,7 +19647,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -19796,7 +19836,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -19982,7 +20022,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -20140,7 +20180,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -20294,7 +20334,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -20367,7 +20407,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20379,7 +20420,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20424,7 +20466,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -20506,7 +20548,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20552,7 +20595,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -20657,7 +20700,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -20760,7 +20803,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -20820,7 +20863,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20832,7 +20876,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20877,7 +20922,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -20946,7 +20991,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20992,7 +21038,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -21052,7 +21098,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21064,7 +21111,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21109,7 +21157,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -21178,7 +21226,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21224,7 +21273,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -21364,7 +21413,8 @@ "type": "integer", "description": "The default SMTP server port.", "default": 587, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -21413,7 +21463,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21425,7 +21476,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21471,7 +21523,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -21610,6 +21662,7 @@ "description": "SMTP port.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -21660,7 +21713,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21713,7 +21767,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -21761,7 +21815,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -21818,7 +21873,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -21921,7 +21976,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -21969,7 +22024,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -22026,7 +22082,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -22129,7 +22185,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -22177,7 +22233,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -22234,7 +22291,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -22337,7 +22394,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -22385,7 +22442,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -22442,7 +22500,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -22543,7 +22601,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -22599,7 +22657,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -22660,7 +22718,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -22742,7 +22800,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -22824,7 +22882,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -22907,7 +22965,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -22996,7 +23054,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -23057,7 +23115,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -23139,7 +23197,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -23200,7 +23258,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -23282,7 +23340,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -23373,7 +23431,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -23461,7 +23519,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -23525,7 +23583,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -23596,7 +23654,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 232, + "weight": 221, "cookies": false, "type": "", "demo": "migrations\/list.md", @@ -23679,7 +23737,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 226, + "weight": 215, "cookies": false, "type": "", "demo": "migrations\/create-appwrite-migration.md", @@ -23742,7 +23800,8 @@ "type": "string", "description": "Source Appwrite endpoint", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "projectId": { "type": "string", @@ -23792,7 +23851,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 234, + "weight": 223, "cookies": false, "type": "", "demo": "migrations\/get-appwrite-report.md", @@ -23901,7 +23960,7 @@ "x-appwrite": { "method": "createCSVExport", "group": null, - "weight": 231, + "weight": 220, "cookies": false, "type": "", "demo": "migrations\/create-csv-export.md", @@ -24027,7 +24086,7 @@ "x-appwrite": { "method": "createCSVImport", "group": null, - "weight": 230, + "weight": 219, "cookies": false, "type": "", "demo": "migrations\/create-csv-import.md", @@ -24118,7 +24177,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 227, + "weight": 216, "cookies": false, "type": "", "demo": "migrations\/create-firebase-migration.md", @@ -24211,7 +24270,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 235, + "weight": 224, "cookies": false, "type": "", "demo": "migrations\/get-firebase-report.md", @@ -24297,7 +24356,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 229, + "weight": 218, "cookies": false, "type": "", "demo": "migrations\/create-n-host-migration.md", @@ -24391,7 +24450,8 @@ "type": "integer", "description": "Source's Database Port", "default": 5432, - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24432,7 +24492,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 237, + "weight": 226, "cookies": false, "type": "", "demo": "migrations\/get-n-host-report.md", @@ -24568,7 +24628,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 228, + "weight": 217, "cookies": false, "type": "", "demo": "migrations\/create-supabase-migration.md", @@ -24626,7 +24686,8 @@ "type": "string", "description": "Source's Supabase Endpoint", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "apiKey": { "type": "string", @@ -24656,7 +24717,8 @@ "type": "integer", "description": "Source's Database Port", "default": 5432, - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24696,7 +24758,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 236, + "weight": 225, "cookies": false, "type": "", "demo": "migrations\/get-supabase-report.md", @@ -24823,7 +24885,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 233, + "weight": 222, "cookies": false, "type": "", "demo": "migrations\/get.md", @@ -24882,7 +24944,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 238, + "weight": 227, "cookies": false, "type": "", "demo": "migrations\/retry.md", @@ -24936,7 +24998,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 239, + "weight": 228, "cookies": false, "type": "", "demo": "migrations\/delete.md", @@ -24995,7 +25057,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 138, + "weight": 127, "cookies": false, "type": "", "demo": "project\/get-usage.md", @@ -25078,7 +25140,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 140, + "weight": 129, "cookies": false, "type": "", "demo": "project\/list-variables.md", @@ -25127,7 +25189,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 139, + "weight": 128, "cookies": false, "type": "", "demo": "project\/create-variable.md", @@ -25209,7 +25271,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 141, + "weight": 130, "cookies": false, "type": "", "demo": "project\/get-variable.md", @@ -25268,7 +25330,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 142, + "weight": 131, "cookies": false, "type": "", "demo": "project\/update-variable.md", @@ -25354,7 +25416,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 143, + "weight": 132, "cookies": false, "type": "", "demo": "project\/delete-variable.md", @@ -25438,7 +25500,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\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "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. You may filter on the following attributes: name, teamId, labels, search", "required": false, "type": "array", "collectionFormat": "multi", @@ -25493,7 +25555,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 92, + "weight": 81, "cookies": false, "type": "", "demo": "projects\/create.md", @@ -25568,7 +25630,8 @@ "type": "string", "description": "Project URL.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25641,7 +25704,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 93, + "weight": 82, "cookies": false, "type": "", "demo": "projects\/get.md", @@ -25700,7 +25763,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 94, + "weight": 83, "cookies": false, "type": "", "demo": "projects\/update.md", @@ -25760,7 +25823,8 @@ "type": "string", "description": "Project URL.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25826,7 +25890,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 111, + "weight": 100, "cookies": false, "type": "", "demo": "projects\/delete.md", @@ -25887,7 +25951,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 98, + "weight": 87, "cookies": false, "type": "", "demo": "projects\/update-api-status.md", @@ -26044,7 +26108,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 99, + "weight": 88, "cookies": false, "type": "", "demo": "projects\/update-api-status-all.md", @@ -26183,7 +26247,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 104, + "weight": 93, "cookies": false, "type": "", "demo": "projects\/update-auth-duration.md", @@ -26225,7 +26289,8 @@ "type": "integer", "description": "Project session length in seconds. Max length: 31536000 seconds.", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26262,7 +26327,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 103, + "weight": 92, "cookies": false, "type": "", "demo": "projects\/update-auth-limit.md", @@ -26304,7 +26369,8 @@ "type": "integer", "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26341,7 +26407,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 109, + "weight": 98, "cookies": false, "type": "", "demo": "projects\/update-auth-sessions-limit.md", @@ -26383,7 +26449,8 @@ "type": "integer", "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" } }, "required": [ @@ -26420,7 +26487,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 102, + "weight": 91, "cookies": false, "type": "", "demo": "projects\/update-memberships-privacy.md", @@ -26513,7 +26580,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 110, + "weight": 99, "cookies": false, "type": "", "demo": "projects\/update-mock-numbers.md", @@ -26595,7 +26662,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 107, + "weight": 96, "cookies": false, "type": "", "demo": "projects\/update-auth-password-dictionary.md", @@ -26674,7 +26741,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 106, + "weight": 95, "cookies": false, "type": "", "demo": "projects\/update-auth-password-history.md", @@ -26716,7 +26783,8 @@ "type": "integer", "description": "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 is20. Default value is 0", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26753,7 +26821,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 108, + "weight": 97, "cookies": false, "type": "", "demo": "projects\/update-personal-data-check.md", @@ -26832,7 +26900,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 101, + "weight": 90, "cookies": false, "type": "", "demo": "projects\/update-session-alerts.md", @@ -26911,7 +26979,7 @@ "x-appwrite": { "method": "updateSessionInvalidation", "group": "auth", - "weight": 137, + "weight": 126, "cookies": false, "type": "", "demo": "projects\/update-session-invalidation.md", @@ -26990,7 +27058,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 105, + "weight": 94, "cookies": false, "type": "", "demo": "projects\/update-auth-status.md", @@ -27459,7 +27527,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 123, + "weight": 112, "cookies": false, "type": "", "demo": "projects\/create-jwt.md", @@ -27569,7 +27637,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -27604,7 +27673,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 119, + "weight": 108, "cookies": false, "type": "", "demo": "projects\/list-keys.md", @@ -27672,7 +27741,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 118, + "weight": 107, "cookies": false, "type": "", "demo": "projects\/create-key.md", @@ -27826,7 +27895,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 120, + "weight": 109, "cookies": false, "type": "", "demo": "projects\/get-key.md", @@ -27893,7 +27962,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 121, + "weight": 110, "cookies": false, "type": "", "demo": "projects\/update-key.md", @@ -28050,7 +28119,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 122, + "weight": 111, "cookies": false, "type": "", "demo": "projects\/delete-key.md", @@ -28093,6 +28162,87 @@ ] } }, + "\/projects\/{projectId}\/labels": { + "put": { + "summary": "Update project labels", + "operationId": "projectsUpdateLabels", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the project labels by its unique ID. Labels can be used to easily filter projects in an organization.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "deprecated": false, + "x-appwrite": { + "method": "updateLabels", + "group": "projects", + "weight": 435, + "cookies": false, + "type": "", + "demo": "projects\/update-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "public": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + ] + } + }, "\/projects\/{projectId}\/oauth2": { "patch": { "summary": "Update project OAuth2", @@ -28119,7 +28269,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 100, + "weight": 89, "cookies": false, "type": "", "demo": "projects\/update-o-auth-2.md", @@ -28201,9 +28351,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -28262,7 +28410,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 125, + "weight": 114, "cookies": false, "type": "", "demo": "projects\/list-platforms.md", @@ -28330,7 +28478,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 124, + "weight": 113, "cookies": false, "type": "", "demo": "projects\/create-platform.md", @@ -28451,7 +28599,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 126, + "weight": 115, "cookies": false, "type": "", "demo": "projects\/get-platform.md", @@ -28518,7 +28666,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 127, + "weight": 116, "cookies": false, "type": "", "demo": "projects\/update-platform.md", @@ -28616,7 +28764,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 128, + "weight": 117, "cookies": false, "type": "", "demo": "projects\/delete-platform.md", @@ -28685,7 +28833,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 96, + "weight": 85, "cookies": false, "type": "", "demo": "projects\/update-service-status.md", @@ -28788,7 +28936,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 97, + "weight": 86, "cookies": false, "type": "", "demo": "projects\/update-service-status-all.md", @@ -28867,7 +29015,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 129, + "weight": 118, "cookies": false, "type": "", "demo": "projects\/update-smtp.md", @@ -28997,13 +29145,15 @@ "type": "string", "description": "Email of the sender", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29015,7 +29165,8 @@ "type": "integer", "description": "SMTP server port", "default": 587, - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29073,7 +29224,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 130, + "weight": 119, "cookies": false, "type": "", "demo": "projects\/create-smtp-test.md", @@ -29210,13 +29361,15 @@ "type": "string", "description": "Email of the sender", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29228,7 +29381,8 @@ "type": "integer", "description": "SMTP server port", "default": 587, - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29292,7 +29446,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 95, + "weight": 84, "cookies": false, "type": "", "demo": "projects\/update-team.md", @@ -29369,7 +29523,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 132, + "weight": 121, "cookies": false, "type": "", "demo": "projects\/get-email-template.md", @@ -29590,7 +29744,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 134, + "weight": 123, "cookies": false, "type": "", "demo": "projects\/update-email-template.md", @@ -29812,13 +29966,15 @@ "type": "string", "description": "Email of the sender", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -29854,7 +30010,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 136, + "weight": 125, "cookies": false, "type": "", "demo": "projects\/delete-email-template.md", @@ -30075,7 +30231,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 131, + "weight": 120, "cookies": false, "type": "", "demo": "projects\/get-sms-template.md", @@ -30357,7 +30513,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 133, + "weight": 122, "cookies": false, "type": "", "demo": "projects\/update-sms-template.md", @@ -30661,7 +30817,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 135, + "weight": 124, "cookies": false, "type": "", "demo": "projects\/delete-sms-template.md", @@ -30943,7 +31099,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 113, + "weight": 102, "cookies": false, "type": "", "demo": "projects\/list-webhooks.md", @@ -31011,7 +31167,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 112, + "weight": 101, "cookies": false, "type": "", "demo": "projects\/create-webhook.md", @@ -31130,7 +31286,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 114, + "weight": 103, "cookies": false, "type": "", "demo": "projects\/get-webhook.md", @@ -31197,7 +31353,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 115, + "weight": 104, "cookies": false, "type": "", "demo": "projects\/update-webhook.md", @@ -31319,7 +31475,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 117, + "weight": 106, "cookies": false, "type": "", "demo": "projects\/delete-webhook.md", @@ -31388,7 +31544,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 116, + "weight": 105, "cookies": false, "type": "", "demo": "projects\/update-webhook-signature.md", @@ -31455,7 +31611,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 510, + "weight": 511, "cookies": false, "type": "", "demo": "proxy\/list-rules.md", @@ -31537,7 +31693,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 505, + "weight": 506, "cookies": false, "type": "", "demo": "proxy\/create-api-rule.md", @@ -31607,7 +31763,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 507, + "weight": 508, "cookies": false, "type": "", "demo": "proxy\/create-function-rule.md", @@ -31690,7 +31846,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 508, + "weight": 509, "cookies": false, "type": "", "demo": "proxy\/create-redirect-rule.md", @@ -31729,7 +31885,8 @@ "type": "string", "description": "Target URL of redirection", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "statusCode": { "type": "string", @@ -31810,7 +31967,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 506, + "weight": 507, "cookies": false, "type": "", "demo": "proxy\/create-site-rule.md", @@ -31891,7 +32048,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 509, + "weight": 510, "cookies": false, "type": "", "demo": "proxy\/get-rule.md", @@ -31944,7 +32101,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 511, + "weight": 512, "cookies": false, "type": "", "demo": "proxy\/delete-rule.md", @@ -32004,7 +32161,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 512, + "weight": 513, "cookies": false, "type": "", "demo": "proxy\/update-rule-verification.md", @@ -32062,7 +32219,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 467, + "weight": 468, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -32144,7 +32301,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 465, + "weight": 466, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -32228,7 +32385,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -32415,7 +32573,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 470, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -32465,7 +32623,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 493, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -32515,7 +32673,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 489, + "weight": 490, "cookies": false, "type": "", "demo": "sites\/list-templates.md", @@ -32638,7 +32796,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 490, + "weight": 491, "cookies": false, "type": "", "demo": "sites\/get-template.md", @@ -32696,7 +32854,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 491, + "weight": 492, "cookies": false, "type": "", "demo": "sites\/list-usage.md", @@ -32766,7 +32924,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 466, + "weight": 467, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -32826,7 +32984,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 468, + "weight": 469, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -32912,7 +33070,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -33092,7 +33251,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 469, + "weight": 470, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -33154,7 +33313,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 476, + "weight": 477, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -33232,7 +33391,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 475, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -33322,7 +33481,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 471, + "weight": 472, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -33423,7 +33582,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 479, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -33503,7 +33662,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 472, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -33624,7 +33783,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 473, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -33722,7 +33881,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 474, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -33785,7 +33944,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 477, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -33853,7 +34012,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 478, + "weight": 479, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -33939,7 +34098,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 480, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -34007,7 +34166,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 482, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -34088,7 +34247,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 481, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -34153,7 +34312,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 483, + "weight": 484, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -34221,7 +34380,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 492, + "weight": 493, "cookies": false, "type": "", "demo": "sites\/get-usage.md", @@ -34299,7 +34458,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 486, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -34359,7 +34518,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 484, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -34450,7 +34609,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 485, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -34518,7 +34677,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 487, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -34613,7 +34772,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 488, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -34681,7 +34840,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 520, + "weight": 521, "cookies": false, "type": "", "demo": "storage\/list-buckets.md", @@ -34764,7 +34923,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 518, + "weight": 519, "cookies": false, "type": "", "demo": "storage\/create-bucket.md", @@ -34834,7 +34993,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -34847,7 +35007,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "default": "none", "x-example": "none", "enum": [ @@ -34910,7 +35070,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 519, + "weight": 520, "cookies": false, "type": "", "demo": "storage\/get-bucket.md", @@ -34971,7 +35131,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 521, + "weight": 522, "cookies": false, "type": "", "demo": "storage\/update-bucket.md", @@ -35043,7 +35203,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -35056,7 +35217,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "default": "none", "x-example": "none", "enum": [ @@ -35113,7 +35274,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 522, + "weight": 523, "cookies": false, "type": "", "demo": "storage\/delete-bucket.md", @@ -35174,7 +35335,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -35267,7 +35428,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -35358,7 +35519,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -35429,7 +35590,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -35520,7 +35681,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -35591,7 +35752,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -35671,7 +35832,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -35879,7 +36040,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -35959,7 +36120,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 532, + "weight": 533, "cookies": false, "type": "", "demo": "storage\/get-usage.md", @@ -36030,7 +36191,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 533, + "weight": 534, "cookies": false, "type": "", "demo": "storage\/get-bucket-usage.md", @@ -36387,7 +36548,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -38107,6 +38269,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -38220,6 +38383,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -38579,6 +38743,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -38586,6 +38751,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -38593,6 +38759,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -38706,6 +38873,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -38713,6 +38881,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -38720,6 +38889,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -38833,6 +39003,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -38840,6 +39011,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -38847,6 +39019,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -38960,6 +39133,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -38967,6 +39141,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -38974,6 +39149,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -40103,7 +40279,8 @@ "type": "integer", "description": "Column size for text columns, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -40243,6 +40420,7 @@ "description": "Maximum size of the string column.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -40356,6 +40534,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -40469,6 +40648,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -42508,13 +42688,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42628,13 +42810,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42872,7 +43056,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -42957,7 +43141,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -43048,7 +43232,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -43111,7 +43295,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -43187,7 +43371,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -43250,7 +43434,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 157, + "weight": 146, "cookies": false, "type": "", "demo": "teams\/list-logs.md", @@ -43330,7 +43514,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -43423,7 +43607,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -43469,7 +43653,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -43481,7 +43666,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -43503,7 +43689,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -43544,7 +43731,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -43615,7 +43802,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -43709,7 +43896,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -43782,7 +43969,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -43877,7 +44064,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -43939,7 +44126,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -44019,7 +44206,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 515, + "weight": 516, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -44108,7 +44295,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 513, + "weight": 514, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -44192,7 +44379,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 514, + "weight": 515, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -44252,7 +44439,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 516, + "weight": 517, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -44323,7 +44510,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 517, + "weight": 518, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -44383,7 +44570,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -44466,7 +44653,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -44509,6 +44696,7 @@ "description": "User email.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { @@ -44516,6 +44704,7 @@ "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -44565,7 +44754,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -44607,13 +44796,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44658,7 +44849,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -44700,13 +44891,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44749,7 +44942,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -44829,7 +45022,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -44892,7 +45085,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -44934,13 +45127,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44985,7 +45180,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -45027,13 +45222,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45078,7 +45275,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -45120,13 +45317,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45138,25 +45337,29 @@ "type": "integer", "description": "Optional CPU cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -45206,7 +45409,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -45248,13 +45451,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45320,7 +45525,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -45362,13 +45567,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -45432,7 +45639,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 189, "cookies": false, "type": "", "demo": "users\/get-usage.md", @@ -45503,7 +45710,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -45559,7 +45766,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -45622,7 +45829,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -45666,7 +45873,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -45703,7 +45911,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -45753,7 +45961,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -45787,7 +45996,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -45869,7 +46078,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -45951,7 +46160,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -46044,7 +46253,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -46180,7 +46389,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -46312,7 +46521,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -46429,7 +46638,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -46546,7 +46755,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -46663,7 +46872,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -46782,7 +46991,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -46863,7 +47072,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -46944,7 +47153,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -46988,7 +47197,8 @@ "type": "string", "description": "User phone number.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -47023,7 +47233,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -47084,7 +47294,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -47163,7 +47373,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -47233,7 +47443,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -47289,7 +47499,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -47347,7 +47557,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -47418,7 +47628,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -47497,7 +47707,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -47579,7 +47789,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -47691,7 +47901,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -47760,7 +47970,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -47851,7 +48061,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -47922,7 +48132,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -47966,13 +48176,15 @@ "type": "integer", "description": "Token length in characters. The default length is 6 characters", "default": 6, - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", "default": 900, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -48006,7 +48218,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -48087,7 +48299,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -48168,7 +48380,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 204, + "weight": 193, "cookies": false, "type": "", "demo": "vcs\/create-repository-detection.md", @@ -48264,7 +48476,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 205, + "weight": 194, "cookies": false, "type": "", "demo": "vcs\/list-repositories.md", @@ -48358,7 +48570,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 206, + "weight": 195, "cookies": false, "type": "", "demo": "vcs\/create-repository.md", @@ -48442,7 +48654,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 207, + "weight": 196, "cookies": false, "type": "", "demo": "vcs\/get-repository.md", @@ -48509,7 +48721,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 208, + "weight": 197, "cookies": false, "type": "", "demo": "vcs\/list-repository-branches.md", @@ -48576,7 +48788,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 203, + "weight": 192, "cookies": false, "type": "", "demo": "vcs\/get-repository-contents.md", @@ -48660,7 +48872,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 213, + "weight": 202, "cookies": false, "type": "", "demo": "vcs\/update-external-deployments.md", @@ -48745,7 +48957,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 210, + "weight": 199, "cookies": false, "type": "", "demo": "vcs\/list-installations.md", @@ -48826,7 +49038,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 211, + "weight": 200, "cookies": false, "type": "", "demo": "vcs\/get-installation.md", @@ -48880,7 +49092,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 212, + "weight": 201, "cookies": false, "type": "", "demo": "vcs\/delete-installation.md", @@ -50858,14 +51070,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -52308,14 +52520,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -54901,7 +55113,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", "x-example": "gzip" }, "encryption": { @@ -54918,6 +55130,12 @@ "type": "boolean", "description": "Image transformations are enabled.", "x-example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "x-example": 128, + "format": "int32" } }, "required": [ @@ -54933,7 +55151,8 @@ "compression", "encryption", "antivirus", - "transformations" + "transformations", + "totalSize" ], "example": { "$id": "5e5ea5c16897e", @@ -54953,7 +55172,8 @@ "compression": "gzip", "encryption": false, "antivirus": false, - "transformations": false + "transformations": false, + "totalSize": 128 } }, "resourceToken": { @@ -57338,6 +57558,16 @@ "description": "Last ping datetime in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, + "labels": { + "type": "array", + "description": "Labels for the project.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -57482,6 +57712,7 @@ "smtpSecure", "pingCount", "pingedAt", + "labels", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -57550,6 +57781,9 @@ "smtpSecure": "tls", "pingCount": 1, "pingedAt": "2020-10-15T06:38:00.000+00:00", + "labels": [ + "vip" + ], "authEmailPassword": true, "authUsersAuthMagicURL": true, "authEmailOtp": true, @@ -59551,171 +59785,6 @@ "description": "Time range of the usage stats.", "x-example": "30d" }, - "deploymentsTotal": { - "type": "integer", - "description": "Total aggregated number of functions deployments.", - "x-example": 0, - "format": "int32" - }, - "deploymentsStorageTotal": { - "type": "integer", - "description": "Total aggregated sum of functions deployment storage.", - "x-example": 0, - "format": "int32" - }, - "buildsTotal": { - "type": "integer", - "description": "Total aggregated number of functions build.", - "x-example": 0, - "format": "int32" - }, - "buildsStorageTotal": { - "type": "integer", - "description": "total aggregated sum of functions build storage.", - "x-example": 0, - "format": "int32" - }, - "buildsTimeTotal": { - "type": "integer", - "description": "Total aggregated sum of functions build compute time.", - "x-example": 0, - "format": "int32" - }, - "buildsMbSecondsTotal": { - "type": "integer", - "description": "Total aggregated sum of functions build mbSeconds.", - "x-example": 0, - "format": "int32" - }, - "executionsTotal": { - "type": "integer", - "description": "Total aggregated number of functions execution.", - "x-example": 0, - "format": "int32" - }, - "executionsTimeTotal": { - "type": "integer", - "description": "Total aggregated sum of functions execution compute time.", - "x-example": 0, - "format": "int32" - }, - "executionsMbSecondsTotal": { - "type": "integer", - "description": "Total aggregated sum of functions execution mbSeconds.", - "x-example": 0, - "format": "int32" - }, - "deployments": { - "type": "array", - "description": "Aggregated number of functions deployment per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "deploymentsStorage": { - "type": "array", - "description": "Aggregated number of functions deployment storage per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsSuccessTotal": { - "type": "integer", - "description": "Total aggregated number of successful function builds.", - "x-example": 0, - "format": "int32" - }, - "buildsFailedTotal": { - "type": "integer", - "description": "Total aggregated number of failed function builds.", - "x-example": 0, - "format": "int32" - }, - "builds": { - "type": "array", - "description": "Aggregated number of functions build per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsStorage": { - "type": "array", - "description": "Aggregated sum of functions build storage per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsTime": { - "type": "array", - "description": "Aggregated sum of functions build compute time per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsMbSeconds": { - "type": "array", - "description": "Aggregated sum of functions build mbSeconds per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "executions": { - "type": "array", - "description": "Aggregated number of functions execution per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "executionsTime": { - "type": "array", - "description": "Aggregated number of functions execution compute time per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "executionsMbSeconds": { - "type": "array", - "description": "Aggregated number of functions mbSeconds per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsSuccess": { - "type": "array", - "description": "Aggregated number of successful function builds per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, - "buildsFailed": { - "type": "array", - "description": "Aggregated number of failed function builds per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": [] - }, "sitesTotal": { "type": "integer", "description": "Total aggregated number of sites.", @@ -59731,6 +59800,60 @@ }, "x-example": [] }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of sites deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of sites deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of sites build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of sites build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of sites build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of sites build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of sites execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of sites execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of sites execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, "requestsTotal": { "type": "integer", "description": "Total aggregated number of requests.", @@ -59775,10 +59898,123 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "deployments": { + "type": "array", + "description": "Aggregated number of sites deployment per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of sites deployment storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful site builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed site builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of sites build per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of sites build storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of sites build compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of sites build mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of sites execution per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of sites execution compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of sites mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful site builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed site builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ "range", + "sitesTotal", + "sites", "deploymentsTotal", "deploymentsStorageTotal", "buildsTotal", @@ -59788,6 +60024,12 @@ "executionsTotal", "executionsTimeTotal", "executionsMbSecondsTotal", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound", "deployments", "deploymentsStorage", "buildsSuccessTotal", @@ -59800,18 +60042,12 @@ "executionsTime", "executionsMbSeconds", "buildsSuccess", - "buildsFailed", - "sitesTotal", - "sites", - "requestsTotal", - "requests", - "inboundTotal", - "inbound", - "outboundTotal", - "outbound" + "buildsFailed" ], "example": { "range": "30d", + "sitesTotal": 0, + "sites": [], "deploymentsTotal": 0, "deploymentsStorageTotal": 0, "buildsTotal": 0, @@ -59821,6 +60057,12 @@ "executionsTotal": 0, "executionsTimeTotal": 0, "executionsMbSecondsTotal": 0, + "requestsTotal": 0, + "requests": [], + "inboundTotal": 0, + "inbound": [], + "outboundTotal": 0, + "outbound": [], "deployments": [], "deploymentsStorage": [], "buildsSuccessTotal": 0, @@ -59833,15 +60075,7 @@ "executionsTime": [], "executionsMbSeconds": [], "buildsSuccess": [], - "buildsFailed": [], - "sitesTotal": 0, - "sites": [], - "requestsTotal": 0, - "requests": [], - "inboundTotal": 0, - "inbound": [], - "outboundTotal": 0, - "outbound": [] + "buildsFailed": [] } }, "usageSite": { @@ -61144,7 +61378,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -61190,7 +61424,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index a3d51a703d..6ad3eb4bce 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.8.0", + "version": "1.8.1", "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", @@ -202,7 +202,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -292,13 +293,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -513,7 +516,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -624,7 +628,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -700,7 +704,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -827,7 +831,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -971,7 +975,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1098,7 +1102,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1238,7 +1242,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1381,7 +1385,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1485,7 +1489,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1589,7 +1593,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1693,7 +1697,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1920,7 +1924,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1996,13 +2001,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2210,13 +2217,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2540,13 +2549,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -3132,7 +3143,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3224,13 +3236,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3343,9 +3357,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3460,7 +3472,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3591,7 +3604,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -3905,7 +3919,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4033,7 +4047,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4167,7 +4181,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4233,7 +4247,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4723,7 +4737,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4809,7 +4823,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -4903,7 +4917,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -4997,7 +5011,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6061,7 +6075,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7809,6 +7824,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -7924,6 +7940,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8289,6 +8306,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8296,6 +8314,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8303,6 +8322,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8418,6 +8438,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8425,6 +8446,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8432,6 +8454,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8547,6 +8570,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -8554,6 +8578,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -8561,6 +8586,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -8676,6 +8702,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -8683,6 +8710,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -8690,6 +8718,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -9839,7 +9868,8 @@ "type": "integer", "description": "Attribute size for text attributes, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -9981,6 +10011,7 @@ "description": "Maximum size of the string attribute.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10096,6 +10127,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10211,6 +10243,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -11746,13 +11779,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -11869,13 +11904,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12308,7 +12345,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "demo": "functions\/list.md", @@ -12391,7 +12428,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 435, + "weight": 436, "cookies": false, "type": "", "demo": "functions\/create.md", @@ -12540,7 +12577,8 @@ "type": "integer", "description": "Function maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -12705,7 +12743,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "demo": "functions\/list-runtimes.md", @@ -12756,7 +12794,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "demo": "functions\/list-specifications.md", @@ -12807,7 +12845,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 436, + "weight": 437, "cookies": false, "type": "", "demo": "functions\/get.md", @@ -12868,7 +12906,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "demo": "functions\/update.md", @@ -13019,7 +13057,8 @@ "type": "integer", "description": "Maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13178,7 +13217,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "demo": "functions\/delete.md", @@ -13241,7 +13280,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 444, + "weight": 445, "cookies": false, "type": "", "demo": "functions\/update-function-deployment.md", @@ -13320,7 +13359,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 445, + "weight": 446, "cookies": false, "type": "", "demo": "functions\/list-deployments.md", @@ -13411,7 +13450,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 442, + "weight": 443, "cookies": false, "type": "upload", "demo": "functions\/create-deployment.md", @@ -13505,7 +13544,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 450, + "weight": 451, "cookies": false, "type": "", "demo": "functions\/create-duplicate-deployment.md", @@ -13592,7 +13631,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 447, + "weight": 448, "cookies": false, "type": "", "demo": "functions\/create-template-deployment.md", @@ -13714,7 +13753,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 448, + "weight": 449, "cookies": false, "type": "", "demo": "functions\/create-vcs-deployment.md", @@ -13812,7 +13851,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 443, + "weight": 444, "cookies": false, "type": "", "demo": "functions\/get-deployment.md", @@ -13876,7 +13915,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 446, + "weight": 447, "cookies": false, "type": "", "demo": "functions\/delete-deployment.md", @@ -13945,7 +13984,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 449, + "weight": 450, "cookies": false, "type": "location", "demo": "functions\/get-deployment-download.md", @@ -14032,7 +14071,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 451, + "weight": 452, "cookies": false, "type": "", "demo": "functions\/update-deployment-status.md", @@ -14101,7 +14140,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 454, + "weight": 455, "cookies": false, "type": "", "demo": "functions\/list-executions.md", @@ -14186,7 +14225,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 452, + "weight": 453, "cookies": false, "type": "", "demo": "functions\/create-execution.md", @@ -14307,7 +14346,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 453, + "weight": 454, "cookies": false, "type": "", "demo": "functions\/get-execution.md", @@ -14374,7 +14413,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 455, + "weight": 456, "cookies": false, "type": "", "demo": "functions\/delete-execution.md", @@ -14443,7 +14482,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 460, + "weight": 461, "cookies": false, "type": "", "demo": "functions\/list-variables.md", @@ -14504,7 +14543,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 458, + "weight": 459, "cookies": false, "type": "", "demo": "functions\/create-variable.md", @@ -14596,7 +14635,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 459, + "weight": 460, "cookies": false, "type": "", "demo": "functions\/get-variable.md", @@ -14665,7 +14704,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 461, + "weight": 462, "cookies": false, "type": "", "demo": "functions\/update-variable.md", @@ -14761,7 +14800,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 462, + "weight": 463, "cookies": false, "type": "", "demo": "functions\/delete-variable.md", @@ -14832,7 +14871,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -14909,7 +14948,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -14984,7 +15023,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -15036,7 +15075,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -15088,7 +15127,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -15140,7 +15179,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -15201,7 +15240,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -15253,7 +15292,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -15305,7 +15344,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -15368,7 +15407,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -15431,7 +15470,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -15503,7 +15542,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -15566,7 +15605,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -15610,6 +15649,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -15653,7 +15693,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -15716,7 +15756,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -15779,7 +15819,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -15842,7 +15882,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -15905,7 +15945,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -15968,7 +16008,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -16031,7 +16071,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -16094,7 +16134,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -16157,7 +16197,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -16209,7 +16249,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -16261,7 +16301,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -16313,7 +16353,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -16368,7 +16408,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -16423,7 +16463,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -16478,7 +16518,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -16533,7 +16573,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -16588,7 +16628,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -16643,7 +16683,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -16698,7 +16738,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -16753,7 +16793,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -16839,7 +16879,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -17000,7 +17040,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -17168,7 +17208,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -17293,7 +17333,8 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", "default": -1, - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -17367,7 +17408,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -17506,6 +17547,7 @@ "description": "Badge for push notification. Available only for iOS platforms.", "default": null, "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -17581,7 +17623,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -17774,7 +17816,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -17966,7 +18008,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -18023,7 +18065,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -18085,7 +18127,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -18168,7 +18210,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -18251,7 +18293,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -18337,7 +18379,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -18529,7 +18571,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -18718,7 +18760,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -18879,7 +18921,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -19036,7 +19078,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -19110,7 +19152,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19122,7 +19165,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19167,7 +19211,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -19250,7 +19294,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19296,7 +19341,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -19402,7 +19447,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -19506,7 +19551,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -19567,7 +19612,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19579,7 +19625,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19624,7 +19671,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -19694,7 +19741,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19740,7 +19788,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -19801,7 +19849,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19813,7 +19862,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19858,7 +19908,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -19928,7 +19978,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19974,7 +20025,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -20117,7 +20168,8 @@ "type": "integer", "description": "The default SMTP server port.", "default": 587, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -20166,7 +20218,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20178,7 +20231,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20224,7 +20278,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -20366,6 +20420,7 @@ "description": "SMTP port.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -20416,7 +20471,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20469,7 +20525,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -20518,7 +20574,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -20575,7 +20632,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -20679,7 +20736,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -20728,7 +20785,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -20785,7 +20843,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -20889,7 +20947,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -20938,7 +20996,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -20995,7 +21054,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -21099,7 +21158,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -21148,7 +21207,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -21205,7 +21265,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -21307,7 +21367,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -21364,7 +21424,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -21426,7 +21486,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -21509,7 +21569,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -21592,7 +21652,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -21676,7 +21736,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -21766,7 +21826,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -21828,7 +21888,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -21911,7 +21971,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -21973,7 +22033,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -22056,7 +22116,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -22148,7 +22208,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -22238,7 +22298,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -22303,7 +22363,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -22376,7 +22436,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 467, + "weight": 468, "cookies": false, "type": "", "demo": "sites\/list.md", @@ -22459,7 +22519,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 465, + "weight": 466, "cookies": false, "type": "", "demo": "sites\/create.md", @@ -22544,7 +22604,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -22731,7 +22792,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 470, + "weight": 471, "cookies": false, "type": "", "demo": "sites\/list-frameworks.md", @@ -22782,7 +22843,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 493, + "weight": 494, "cookies": false, "type": "", "demo": "sites\/list-specifications.md", @@ -22833,7 +22894,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 466, + "weight": 467, "cookies": false, "type": "", "demo": "sites\/get.md", @@ -22894,7 +22955,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 468, + "weight": 469, "cookies": false, "type": "", "demo": "sites\/update.md", @@ -22981,7 +23042,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -23161,7 +23223,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 469, + "weight": 470, "cookies": false, "type": "", "demo": "sites\/delete.md", @@ -23224,7 +23286,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 476, + "weight": 477, "cookies": false, "type": "", "demo": "sites\/update-site-deployment.md", @@ -23303,7 +23365,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 475, + "weight": 476, "cookies": false, "type": "", "demo": "sites\/list-deployments.md", @@ -23394,7 +23456,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 471, + "weight": 472, "cookies": false, "type": "upload", "demo": "sites\/create-deployment.md", @@ -23496,7 +23558,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 479, + "weight": 480, "cookies": false, "type": "", "demo": "sites\/create-duplicate-deployment.md", @@ -23577,7 +23639,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 472, + "weight": 473, "cookies": false, "type": "", "demo": "sites\/create-template-deployment.md", @@ -23699,7 +23761,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 473, + "weight": 474, "cookies": false, "type": "", "demo": "sites\/create-vcs-deployment.md", @@ -23798,7 +23860,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 474, + "weight": 475, "cookies": false, "type": "", "demo": "sites\/get-deployment.md", @@ -23862,7 +23924,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 477, + "weight": 478, "cookies": false, "type": "", "demo": "sites\/delete-deployment.md", @@ -23931,7 +23993,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 478, + "weight": 479, "cookies": false, "type": "location", "demo": "sites\/get-deployment-download.md", @@ -24018,7 +24080,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 480, + "weight": 481, "cookies": false, "type": "", "demo": "sites\/update-deployment-status.md", @@ -24087,7 +24149,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 482, + "weight": 483, "cookies": false, "type": "", "demo": "sites\/list-logs.md", @@ -24169,7 +24231,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 481, + "weight": 482, "cookies": false, "type": "", "demo": "sites\/get-log.md", @@ -24235,7 +24297,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 483, + "weight": 484, "cookies": false, "type": "", "demo": "sites\/delete-log.md", @@ -24304,7 +24366,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 486, + "weight": 487, "cookies": false, "type": "", "demo": "sites\/list-variables.md", @@ -24365,7 +24427,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 484, + "weight": 485, "cookies": false, "type": "", "demo": "sites\/create-variable.md", @@ -24457,7 +24519,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 485, + "weight": 486, "cookies": false, "type": "", "demo": "sites\/get-variable.md", @@ -24526,7 +24588,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 487, + "weight": 488, "cookies": false, "type": "", "demo": "sites\/update-variable.md", @@ -24622,7 +24684,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 488, + "weight": 489, "cookies": false, "type": "", "demo": "sites\/delete-variable.md", @@ -24691,7 +24753,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 520, + "weight": 521, "cookies": false, "type": "", "demo": "storage\/list-buckets.md", @@ -24775,7 +24837,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 518, + "weight": 519, "cookies": false, "type": "", "demo": "storage\/create-bucket.md", @@ -24846,7 +24908,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -24859,7 +24922,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "default": "none", "x-example": "none", "enum": [ @@ -24922,7 +24985,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 519, + "weight": 520, "cookies": false, "type": "", "demo": "storage\/get-bucket.md", @@ -24984,7 +25047,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 521, + "weight": 522, "cookies": false, "type": "", "demo": "storage\/update-bucket.md", @@ -25057,7 +25120,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -25070,7 +25134,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "description": "Compression algorithm chosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", "default": "none", "x-example": "none", "enum": [ @@ -25127,7 +25191,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 522, + "weight": 523, "cookies": false, "type": "", "demo": "storage\/delete-bucket.md", @@ -25189,7 +25253,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 525, + "weight": 526, "cookies": false, "type": "", "demo": "storage\/list-files.md", @@ -25284,7 +25348,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 523, + "weight": 524, "cookies": false, "type": "upload", "demo": "storage\/create-file.md", @@ -25377,7 +25441,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 524, + "weight": 525, "cookies": false, "type": "", "demo": "storage\/get-file.md", @@ -25450,7 +25514,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 526, + "weight": 527, "cookies": false, "type": "", "demo": "storage\/update-file.md", @@ -25543,7 +25607,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 527, + "weight": 528, "cookies": false, "type": "", "demo": "storage\/delete-file.md", @@ -25616,7 +25680,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 529, + "weight": 530, "cookies": false, "type": "location", "demo": "storage\/get-file-download.md", @@ -25698,7 +25762,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 528, + "weight": 529, "cookies": false, "type": "location", "demo": "storage\/get-file-preview.md", @@ -25908,7 +25972,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 530, + "weight": 531, "cookies": false, "type": "location", "demo": "storage\/get-file-view.md", @@ -26274,7 +26338,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -27919,6 +27984,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -28033,6 +28099,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -28395,6 +28462,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -28402,6 +28470,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -28409,6 +28478,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -28523,6 +28593,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -28530,6 +28601,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -28537,6 +28609,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -28651,6 +28724,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -28658,6 +28732,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -28665,6 +28740,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -28779,6 +28855,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -28786,6 +28863,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -28793,6 +28871,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -29932,7 +30011,8 @@ "type": "integer", "description": "Column size for text columns, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -30073,6 +30153,7 @@ "description": "Maximum size of the string column.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -30187,6 +30268,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -30301,6 +30383,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -32196,13 +32279,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32318,13 +32403,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32364,7 +32451,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -32451,7 +32538,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -32544,7 +32631,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -32609,7 +32696,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -32687,7 +32774,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -32752,7 +32839,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -32847,7 +32934,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -32895,7 +32982,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -32907,7 +32995,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -32929,7 +33018,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -32970,7 +33060,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -33043,7 +33133,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -33139,7 +33229,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -33214,7 +33304,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -33311,7 +33401,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -33375,7 +33465,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -33457,7 +33547,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 515, + "weight": 516, "cookies": false, "type": "", "demo": "tokens\/list.md", @@ -33547,7 +33637,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 513, + "weight": 514, "cookies": false, "type": "", "demo": "tokens\/create-file-token.md", @@ -33632,7 +33722,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 514, + "weight": 515, "cookies": false, "type": "", "demo": "tokens\/get.md", @@ -33693,7 +33783,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 516, + "weight": 517, "cookies": false, "type": "", "demo": "tokens\/update.md", @@ -33765,7 +33855,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 517, + "weight": 518, "cookies": false, "type": "", "demo": "tokens\/delete.md", @@ -33826,7 +33916,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -33910,7 +34000,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -33954,6 +34044,7 @@ "description": "User email.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { @@ -33961,6 +34052,7 @@ "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -34010,7 +34102,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -34053,13 +34145,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34104,7 +34198,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -34147,13 +34241,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34196,7 +34292,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -34277,7 +34373,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -34341,7 +34437,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -34384,13 +34480,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34435,7 +34533,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -34478,13 +34576,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34529,7 +34629,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -34572,13 +34672,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34590,25 +34692,29 @@ "type": "integer", "description": "Optional CPU cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -34658,7 +34764,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -34701,13 +34807,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34773,7 +34881,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -34816,13 +34924,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -34886,7 +34996,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -34943,7 +35053,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -35007,7 +35117,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -35052,7 +35162,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -35089,7 +35200,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -35140,7 +35251,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -35174,7 +35286,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -35257,7 +35369,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -35340,7 +35452,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -35434,7 +35546,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -35573,7 +35685,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -35708,7 +35820,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -35828,7 +35940,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -35948,7 +36060,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -36068,7 +36180,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -36190,7 +36302,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -36272,7 +36384,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -36354,7 +36466,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -36399,7 +36511,8 @@ "type": "string", "description": "User phone number.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -36434,7 +36547,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -36496,7 +36609,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -36576,7 +36689,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -36647,7 +36760,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -36704,7 +36817,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -36763,7 +36876,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -36835,7 +36948,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -36915,7 +37028,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -36998,7 +37111,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -37111,7 +37224,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -37181,7 +37294,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -37273,7 +37386,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -37345,7 +37458,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -37390,13 +37503,15 @@ "type": "integer", "description": "Token length in characters. The default length is 6 characters", "default": 6, - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", "default": 900, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -37430,7 +37545,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -37512,7 +37627,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -39105,14 +39220,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -40555,14 +40670,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -43148,7 +43263,7 @@ }, "compression": { "type": "string", - "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "description": "Compression algorithm chosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", "x-example": "gzip" }, "encryption": { @@ -43165,6 +43280,12 @@ "type": "boolean", "description": "Image transformations are enabled.", "x-example": false + }, + "totalSize": { + "type": "integer", + "description": "Total size of this bucket in bytes.", + "x-example": 128, + "format": "int32" } }, "required": [ @@ -43180,7 +43301,8 @@ "compression", "encryption", "antivirus", - "transformations" + "transformations", + "totalSize" ], "example": { "$id": "5e5ea5c16897e", @@ -43200,7 +43322,8 @@ "compression": "gzip", "encryption": false, "antivirus": false, - "transformations": false + "transformations": false, + "totalSize": 128 } }, "resourceToken": { @@ -45224,7 +45347,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -45270,7 +45393,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 07889bba5e..0df8d6f382 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -191,7 +191,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -280,13 +281,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -498,7 +501,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -608,7 +612,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -683,7 +687,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -807,7 +811,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -948,7 +952,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1072,7 +1076,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1209,7 +1213,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1349,7 +1353,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1450,7 +1454,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1551,7 +1555,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1652,7 +1656,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1874,7 +1878,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1949,13 +1954,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2160,13 +2167,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2485,13 +2494,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2683,9 +2694,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3429,7 +3438,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3520,13 +3530,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3638,9 +3650,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3754,7 +3764,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3882,7 +3893,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4191,7 +4203,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4317,7 +4329,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4449,7 +4461,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4513,7 +4525,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -5001,7 +5013,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -5085,7 +5097,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5177,7 +5189,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5269,7 +5281,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6087,7 +6099,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7208,13 +7221,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7329,13 +7344,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -7649,7 +7666,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -7724,7 +7741,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -7797,7 +7814,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -7850,7 +7867,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -7903,7 +7920,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -7956,7 +7973,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -8009,7 +8026,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -8062,7 +8079,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -8115,7 +8132,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -8168,7 +8185,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -8223,7 +8240,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -8308,7 +8325,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -9275,7 +9292,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -10393,13 +10411,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10513,13 +10533,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -10559,7 +10581,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -10644,7 +10666,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -10735,7 +10757,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -10798,7 +10820,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -10874,7 +10896,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -10937,7 +10959,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -11030,7 +11052,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -11076,7 +11098,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -11088,7 +11111,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -11110,7 +11134,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -11151,7 +11176,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -11222,7 +11247,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -11316,7 +11341,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -11389,7 +11414,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -11485,7 +11510,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -11548,7 +11573,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -13368,6 +13393,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -13381,7 +13416,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -13396,7 +13433,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "team": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 4b384cae76..3f2b3d4447 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -201,7 +201,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -333,13 +334,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -548,7 +551,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -657,7 +661,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -731,7 +735,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -854,7 +858,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -994,7 +998,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1117,7 +1121,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1253,7 +1257,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1392,7 +1396,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1492,7 +1496,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1592,7 +1596,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1692,7 +1696,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1911,7 +1915,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1985,13 +1990,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2193,13 +2200,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2513,13 +2522,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2709,9 +2720,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3445,7 +3454,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3535,13 +3545,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3652,9 +3664,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3767,7 +3777,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3894,7 +3905,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -4200,7 +4212,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4326,7 +4338,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4458,7 +4470,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4522,7 +4534,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -5010,7 +5022,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -5094,7 +5106,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -5186,7 +5198,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -5278,7 +5290,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6518,7 +6530,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -8343,6 +8356,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -8457,6 +8471,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8819,6 +8834,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8826,6 +8842,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8833,6 +8850,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8947,6 +8965,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8954,6 +8973,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8961,6 +8981,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -9075,6 +9096,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -9082,6 +9104,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -9089,6 +9112,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -9203,6 +9227,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -9210,6 +9235,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -9217,6 +9243,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -10356,7 +10383,8 @@ "type": "integer", "description": "Attribute size for text attributes, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -10497,6 +10525,7 @@ "description": "Maximum size of the string attribute.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10611,6 +10640,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10725,6 +10755,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -12327,13 +12358,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12448,13 +12481,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -13505,7 +13540,8 @@ "type": "integer", "description": "Function maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14292,7 +14328,8 @@ "type": "integer", "description": "Maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -16160,7 +16197,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -16235,7 +16272,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -16308,7 +16345,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -16359,7 +16396,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -16410,7 +16447,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -16461,7 +16498,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -16521,7 +16558,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -16572,7 +16609,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -16623,7 +16660,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -16685,7 +16722,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -16747,7 +16784,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -16818,7 +16855,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -16880,7 +16917,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -16923,6 +16960,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -16966,7 +17004,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -17028,7 +17066,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -17090,7 +17128,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -17152,7 +17190,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -17214,7 +17252,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -17276,7 +17314,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -17338,7 +17376,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -17400,7 +17438,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -17462,7 +17500,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -17513,7 +17551,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -17564,7 +17602,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -17615,7 +17653,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -17668,7 +17706,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -17721,7 +17759,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -17774,7 +17812,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -17827,7 +17865,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -17880,7 +17918,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -17933,7 +17971,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -17986,7 +18024,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -18039,7 +18077,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -18124,7 +18162,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -18284,7 +18322,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -18451,7 +18489,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -18575,7 +18613,8 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", "default": -1, - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -18649,7 +18688,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -18787,6 +18826,7 @@ "description": "Badge for push notification. Available only for iOS platforms.", "default": null, "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -18862,7 +18902,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -19052,7 +19092,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -19241,7 +19281,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -19297,7 +19337,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -19358,7 +19398,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -19440,7 +19480,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -19522,7 +19562,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -19607,7 +19647,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -19796,7 +19836,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -19982,7 +20022,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -20140,7 +20180,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -20294,7 +20334,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -20367,7 +20407,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20379,7 +20420,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20424,7 +20466,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -20506,7 +20548,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20552,7 +20595,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -20657,7 +20700,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -20760,7 +20803,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -20820,7 +20863,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20832,7 +20876,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20877,7 +20922,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -20946,7 +20991,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20992,7 +21038,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -21052,7 +21098,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21064,7 +21111,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21109,7 +21157,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -21178,7 +21226,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21224,7 +21273,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -21364,7 +21413,8 @@ "type": "integer", "description": "The default SMTP server port.", "default": 587, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -21413,7 +21463,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21425,7 +21476,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -21471,7 +21523,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -21610,6 +21662,7 @@ "description": "SMTP port.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -21660,7 +21713,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -21713,7 +21767,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -21761,7 +21815,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -21818,7 +21873,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -21921,7 +21976,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -21969,7 +22024,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -22026,7 +22082,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -22129,7 +22185,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -22177,7 +22233,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -22234,7 +22291,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -22337,7 +22394,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -22385,7 +22442,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -22442,7 +22500,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -22543,7 +22601,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -22599,7 +22657,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -22660,7 +22718,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -22742,7 +22800,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -22824,7 +22882,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -22907,7 +22965,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -22996,7 +23054,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -23057,7 +23115,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -23139,7 +23197,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -23200,7 +23258,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -23282,7 +23340,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -23373,7 +23431,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -23461,7 +23519,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -23525,7 +23583,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -23596,7 +23654,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 232, + "weight": 221, "cookies": false, "type": "", "demo": "migrations\/list.md", @@ -23679,7 +23737,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 226, + "weight": 215, "cookies": false, "type": "", "demo": "migrations\/create-appwrite-migration.md", @@ -23742,7 +23800,8 @@ "type": "string", "description": "Source Appwrite endpoint", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "projectId": { "type": "string", @@ -23792,7 +23851,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 234, + "weight": 223, "cookies": false, "type": "", "demo": "migrations\/get-appwrite-report.md", @@ -23901,7 +23960,7 @@ "x-appwrite": { "method": "createCSVExport", "group": null, - "weight": 231, + "weight": 220, "cookies": false, "type": "", "demo": "migrations\/create-csv-export.md", @@ -24027,7 +24086,7 @@ "x-appwrite": { "method": "createCSVImport", "group": null, - "weight": 230, + "weight": 219, "cookies": false, "type": "", "demo": "migrations\/create-csv-import.md", @@ -24118,7 +24177,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 227, + "weight": 216, "cookies": false, "type": "", "demo": "migrations\/create-firebase-migration.md", @@ -24211,7 +24270,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 235, + "weight": 224, "cookies": false, "type": "", "demo": "migrations\/get-firebase-report.md", @@ -24297,7 +24356,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 229, + "weight": 218, "cookies": false, "type": "", "demo": "migrations\/create-n-host-migration.md", @@ -24391,7 +24450,8 @@ "type": "integer", "description": "Source's Database Port", "default": 5432, - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24432,7 +24492,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 237, + "weight": 226, "cookies": false, "type": "", "demo": "migrations\/get-n-host-report.md", @@ -24568,7 +24628,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 228, + "weight": 217, "cookies": false, "type": "", "demo": "migrations\/create-supabase-migration.md", @@ -24626,7 +24686,8 @@ "type": "string", "description": "Source's Supabase Endpoint", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "apiKey": { "type": "string", @@ -24656,7 +24717,8 @@ "type": "integer", "description": "Source's Database Port", "default": 5432, - "x-example": null + "x-example": null, + "format": "int32" } }, "required": [ @@ -24696,7 +24758,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 236, + "weight": 225, "cookies": false, "type": "", "demo": "migrations\/get-supabase-report.md", @@ -24823,7 +24885,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 233, + "weight": 222, "cookies": false, "type": "", "demo": "migrations\/get.md", @@ -24882,7 +24944,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 238, + "weight": 227, "cookies": false, "type": "", "demo": "migrations\/retry.md", @@ -24936,7 +24998,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 239, + "weight": 228, "cookies": false, "type": "", "demo": "migrations\/delete.md", @@ -24995,7 +25057,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 138, + "weight": 127, "cookies": false, "type": "", "demo": "project\/get-usage.md", @@ -25078,7 +25140,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 140, + "weight": 129, "cookies": false, "type": "", "demo": "project\/list-variables.md", @@ -25127,7 +25189,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 139, + "weight": 128, "cookies": false, "type": "", "demo": "project\/create-variable.md", @@ -25209,7 +25271,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 141, + "weight": 130, "cookies": false, "type": "", "demo": "project\/get-variable.md", @@ -25268,7 +25330,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 142, + "weight": 131, "cookies": false, "type": "", "demo": "project\/update-variable.md", @@ -25354,7 +25416,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 143, + "weight": 132, "cookies": false, "type": "", "demo": "project\/delete-variable.md", @@ -25438,7 +25500,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\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels", + "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. You may filter on the following attributes: name, teamId, labels, search", "required": false, "type": "array", "collectionFormat": "multi", @@ -25493,7 +25555,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 92, + "weight": 81, "cookies": false, "type": "", "demo": "projects\/create.md", @@ -25568,7 +25630,8 @@ "type": "string", "description": "Project URL.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25641,7 +25704,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 93, + "weight": 82, "cookies": false, "type": "", "demo": "projects\/get.md", @@ -25700,7 +25763,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 94, + "weight": 83, "cookies": false, "type": "", "demo": "projects\/update.md", @@ -25760,7 +25823,8 @@ "type": "string", "description": "Project URL.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "legalName": { "type": "string", @@ -25826,7 +25890,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 111, + "weight": 100, "cookies": false, "type": "", "demo": "projects\/delete.md", @@ -25887,7 +25951,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 98, + "weight": 87, "cookies": false, "type": "", "demo": "projects\/update-api-status.md", @@ -26044,7 +26108,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 99, + "weight": 88, "cookies": false, "type": "", "demo": "projects\/update-api-status-all.md", @@ -26183,7 +26247,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 104, + "weight": 93, "cookies": false, "type": "", "demo": "projects\/update-auth-duration.md", @@ -26225,7 +26289,8 @@ "type": "integer", "description": "Project session length in seconds. Max length: 31536000 seconds.", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26262,7 +26327,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 103, + "weight": 92, "cookies": false, "type": "", "demo": "projects\/update-auth-limit.md", @@ -26304,7 +26369,8 @@ "type": "integer", "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26341,7 +26407,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 109, + "weight": 98, "cookies": false, "type": "", "demo": "projects\/update-auth-sessions-limit.md", @@ -26383,7 +26449,8 @@ "type": "integer", "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" } }, "required": [ @@ -26420,7 +26487,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 102, + "weight": 91, "cookies": false, "type": "", "demo": "projects\/update-memberships-privacy.md", @@ -26513,7 +26580,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 110, + "weight": 99, "cookies": false, "type": "", "demo": "projects\/update-mock-numbers.md", @@ -26595,7 +26662,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 107, + "weight": 96, "cookies": false, "type": "", "demo": "projects\/update-auth-password-dictionary.md", @@ -26674,7 +26741,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 106, + "weight": 95, "cookies": false, "type": "", "demo": "projects\/update-auth-password-history.md", @@ -26716,7 +26783,8 @@ "type": "integer", "description": "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 is20. Default value is 0", "default": null, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -26753,7 +26821,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 108, + "weight": 97, "cookies": false, "type": "", "demo": "projects\/update-personal-data-check.md", @@ -26832,7 +26900,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 101, + "weight": 90, "cookies": false, "type": "", "demo": "projects\/update-session-alerts.md", @@ -26911,7 +26979,7 @@ "x-appwrite": { "method": "updateSessionInvalidation", "group": "auth", - "weight": 137, + "weight": 126, "cookies": false, "type": "", "demo": "projects\/update-session-invalidation.md", @@ -26990,7 +27058,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 105, + "weight": 94, "cookies": false, "type": "", "demo": "projects\/update-auth-status.md", @@ -27459,7 +27527,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 123, + "weight": 112, "cookies": false, "type": "", "demo": "projects\/create-jwt.md", @@ -27569,7 +27637,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } }, "required": [ @@ -27604,7 +27673,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 119, + "weight": 108, "cookies": false, "type": "", "demo": "projects\/list-keys.md", @@ -27672,7 +27741,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 118, + "weight": 107, "cookies": false, "type": "", "demo": "projects\/create-key.md", @@ -27826,7 +27895,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 120, + "weight": 109, "cookies": false, "type": "", "demo": "projects\/get-key.md", @@ -27893,7 +27962,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 121, + "weight": 110, "cookies": false, "type": "", "demo": "projects\/update-key.md", @@ -28050,7 +28119,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 122, + "weight": 111, "cookies": false, "type": "", "demo": "projects\/delete-key.md", @@ -28200,7 +28269,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 100, + "weight": 89, "cookies": false, "type": "", "demo": "projects\/update-o-auth-2.md", @@ -28282,9 +28351,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [] @@ -28343,7 +28410,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 125, + "weight": 114, "cookies": false, "type": "", "demo": "projects\/list-platforms.md", @@ -28411,7 +28478,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 124, + "weight": 113, "cookies": false, "type": "", "demo": "projects\/create-platform.md", @@ -28532,7 +28599,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 126, + "weight": 115, "cookies": false, "type": "", "demo": "projects\/get-platform.md", @@ -28599,7 +28666,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 127, + "weight": 116, "cookies": false, "type": "", "demo": "projects\/update-platform.md", @@ -28697,7 +28764,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 128, + "weight": 117, "cookies": false, "type": "", "demo": "projects\/delete-platform.md", @@ -28766,7 +28833,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 96, + "weight": 85, "cookies": false, "type": "", "demo": "projects\/update-service-status.md", @@ -28869,7 +28936,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 97, + "weight": 86, "cookies": false, "type": "", "demo": "projects\/update-service-status-all.md", @@ -28948,7 +29015,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 129, + "weight": 118, "cookies": false, "type": "", "demo": "projects\/update-smtp.md", @@ -29078,13 +29145,15 @@ "type": "string", "description": "Email of the sender", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29096,7 +29165,8 @@ "type": "integer", "description": "SMTP server port", "default": 587, - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29154,7 +29224,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 130, + "weight": 119, "cookies": false, "type": "", "demo": "projects\/create-smtp-test.md", @@ -29291,13 +29361,15 @@ "type": "string", "description": "Email of the sender", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "host": { "type": "string", @@ -29309,7 +29381,8 @@ "type": "integer", "description": "SMTP server port", "default": 587, - "x-example": null + "x-example": null, + "format": "int32" }, "username": { "type": "string", @@ -29373,7 +29446,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 95, + "weight": 84, "cookies": false, "type": "", "demo": "projects\/update-team.md", @@ -29450,7 +29523,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 132, + "weight": 121, "cookies": false, "type": "", "demo": "projects\/get-email-template.md", @@ -29671,7 +29744,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 134, + "weight": 123, "cookies": false, "type": "", "demo": "projects\/update-email-template.md", @@ -29893,13 +29966,15 @@ "type": "string", "description": "Email of the sender", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyTo": { "type": "string", "description": "Reply to email", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -29935,7 +30010,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 136, + "weight": 125, "cookies": false, "type": "", "demo": "projects\/delete-email-template.md", @@ -30156,7 +30231,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 131, + "weight": 120, "cookies": false, "type": "", "demo": "projects\/get-sms-template.md", @@ -30438,7 +30513,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 133, + "weight": 122, "cookies": false, "type": "", "demo": "projects\/update-sms-template.md", @@ -30742,7 +30817,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 135, + "weight": 124, "cookies": false, "type": "", "demo": "projects\/delete-sms-template.md", @@ -31024,7 +31099,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 113, + "weight": 102, "cookies": false, "type": "", "demo": "projects\/list-webhooks.md", @@ -31092,7 +31167,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 112, + "weight": 101, "cookies": false, "type": "", "demo": "projects\/create-webhook.md", @@ -31211,7 +31286,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 114, + "weight": 103, "cookies": false, "type": "", "demo": "projects\/get-webhook.md", @@ -31278,7 +31353,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 115, + "weight": 104, "cookies": false, "type": "", "demo": "projects\/update-webhook.md", @@ -31400,7 +31475,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 117, + "weight": 106, "cookies": false, "type": "", "demo": "projects\/delete-webhook.md", @@ -31469,7 +31544,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 116, + "weight": 105, "cookies": false, "type": "", "demo": "projects\/update-webhook-signature.md", @@ -31810,7 +31885,8 @@ "type": "string", "description": "Target URL of redirection", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "statusCode": { "type": "string", @@ -32309,7 +32385,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -32993,7 +33070,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -34915,7 +34993,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -35124,7 +35203,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -36468,7 +36548,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -38188,6 +38269,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -38301,6 +38383,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -38660,6 +38743,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -38667,6 +38751,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -38674,6 +38759,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -38787,6 +38873,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -38794,6 +38881,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -38801,6 +38889,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -38914,6 +39003,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -38921,6 +39011,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -38928,6 +39019,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -39041,6 +39133,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -39048,6 +39141,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -39055,6 +39149,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -40184,7 +40279,8 @@ "type": "integer", "description": "Column size for text columns, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -40324,6 +40420,7 @@ "description": "Maximum size of the string column.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -40437,6 +40534,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -40550,6 +40648,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -42589,13 +42688,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42709,13 +42810,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -42953,7 +43056,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -43038,7 +43141,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -43129,7 +43232,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -43192,7 +43295,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -43268,7 +43371,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -43331,7 +43434,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 157, + "weight": 146, "cookies": false, "type": "", "demo": "teams\/list-logs.md", @@ -43411,7 +43514,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -43504,7 +43607,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -43550,7 +43653,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -43562,7 +43666,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -43584,7 +43689,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -43625,7 +43731,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -43696,7 +43802,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -43790,7 +43896,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -43863,7 +43969,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -43958,7 +44064,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -44020,7 +44126,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -44464,7 +44570,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -44547,7 +44653,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -44590,6 +44696,7 @@ "description": "User email.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { @@ -44597,6 +44704,7 @@ "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -44646,7 +44754,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -44688,13 +44796,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44739,7 +44849,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -44781,13 +44891,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -44830,7 +44942,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -44910,7 +45022,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -44973,7 +45085,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -45015,13 +45127,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45066,7 +45180,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -45108,13 +45222,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -45159,7 +45275,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -45201,13 +45317,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45219,25 +45337,29 @@ "type": "integer", "description": "Optional CPU cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -45287,7 +45409,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -45329,13 +45451,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -45401,7 +45525,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -45443,13 +45567,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -45513,7 +45639,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 189, "cookies": false, "type": "", "demo": "users\/get-usage.md", @@ -45584,7 +45710,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -45640,7 +45766,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -45703,7 +45829,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -45747,7 +45873,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -45784,7 +45911,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -45834,7 +45961,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -45868,7 +45996,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -45950,7 +46078,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -46032,7 +46160,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -46125,7 +46253,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -46261,7 +46389,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -46393,7 +46521,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -46510,7 +46638,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -46627,7 +46755,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -46744,7 +46872,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -46863,7 +46991,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -46944,7 +47072,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -47025,7 +47153,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -47069,7 +47197,8 @@ "type": "string", "description": "User phone number.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -47104,7 +47233,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -47165,7 +47294,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -47244,7 +47373,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -47314,7 +47443,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -47370,7 +47499,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -47428,7 +47557,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -47499,7 +47628,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -47578,7 +47707,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -47660,7 +47789,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -47772,7 +47901,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -47841,7 +47970,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -47932,7 +48061,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -48003,7 +48132,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -48047,13 +48176,15 @@ "type": "integer", "description": "Token length in characters. The default length is 6 characters", "default": 6, - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", "default": 900, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -48087,7 +48218,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -48168,7 +48299,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -48249,7 +48380,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 204, + "weight": 193, "cookies": false, "type": "", "demo": "vcs\/create-repository-detection.md", @@ -48345,7 +48476,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 205, + "weight": 194, "cookies": false, "type": "", "demo": "vcs\/list-repositories.md", @@ -48439,7 +48570,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 206, + "weight": 195, "cookies": false, "type": "", "demo": "vcs\/create-repository.md", @@ -48523,7 +48654,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 207, + "weight": 196, "cookies": false, "type": "", "demo": "vcs\/get-repository.md", @@ -48590,7 +48721,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 208, + "weight": 197, "cookies": false, "type": "", "demo": "vcs\/list-repository-branches.md", @@ -48657,7 +48788,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 203, + "weight": 192, "cookies": false, "type": "", "demo": "vcs\/get-repository-contents.md", @@ -48741,7 +48872,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 213, + "weight": 202, "cookies": false, "type": "", "demo": "vcs\/update-external-deployments.md", @@ -48826,7 +48957,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 210, + "weight": 199, "cookies": false, "type": "", "demo": "vcs\/list-installations.md", @@ -48907,7 +49038,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 211, + "weight": 200, "cookies": false, "type": "", "demo": "vcs\/get-installation.md", @@ -48961,7 +49092,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 212, + "weight": 201, "cookies": false, "type": "", "demo": "vcs\/delete-installation.md", @@ -50939,14 +51070,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -52389,14 +52520,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -54888,6 +55019,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -54901,7 +55042,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -54916,7 +55059,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "bucket": { @@ -61247,7 +61392,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -61293,7 +61438,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 63e43dbf69..2a452b8658 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -202,7 +202,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", @@ -292,13 +293,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -513,7 +516,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -624,7 +628,7 @@ "x-appwrite": { "method": "updateMFA", "group": "mfa", - "weight": 288, + "weight": 277, "cookies": false, "type": "", "demo": "account\/update-mfa.md", @@ -700,7 +704,7 @@ "x-appwrite": { "method": "createMfaAuthenticator", "group": "mfa", - "weight": 290, + "weight": 279, "cookies": false, "type": "", "demo": "account\/create-mfa-authenticator.md", @@ -827,7 +831,7 @@ "x-appwrite": { "method": "updateMfaAuthenticator", "group": "mfa", - "weight": 291, + "weight": 280, "cookies": false, "type": "", "demo": "account\/update-mfa-authenticator.md", @@ -971,7 +975,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 292, + "weight": 281, "cookies": false, "type": "", "demo": "account\/delete-mfa-authenticator.md", @@ -1098,7 +1102,7 @@ "x-appwrite": { "method": "createMfaChallenge", "group": "mfa", - "weight": 296, + "weight": 285, "cookies": false, "type": "", "demo": "account\/create-mfa-challenge.md", @@ -1238,7 +1242,7 @@ "x-appwrite": { "method": "updateMfaChallenge", "group": "mfa", - "weight": 297, + "weight": 286, "cookies": false, "type": "", "demo": "account\/update-mfa-challenge.md", @@ -1381,7 +1385,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 289, + "weight": 278, "cookies": false, "type": "", "demo": "account\/list-mfa-factors.md", @@ -1485,7 +1489,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 295, + "weight": 284, "cookies": false, "type": "", "demo": "account\/get-mfa-recovery-codes.md", @@ -1589,7 +1593,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 293, + "weight": 282, "cookies": false, "type": "", "demo": "account\/create-mfa-recovery-codes.md", @@ -1693,7 +1697,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 294, + "weight": 283, "cookies": false, "type": "", "demo": "account\/update-mfa-recovery-codes.md", @@ -1920,7 +1924,8 @@ "type": "string", "description": "Current user password. Must be at least 8 chars.", "default": "", - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -1996,13 +2001,15 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -2210,13 +2217,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the recovery 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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -2540,13 +2549,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password. Must be at least 8 chars.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" } }, "required": [ @@ -3132,7 +3143,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "phrase": { "type": "boolean", @@ -3224,13 +3236,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "url": { "type": "string", "description": "URL to redirect the user back to your app from the magic URL login. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "phrase": { "type": "boolean", @@ -3343,9 +3357,7 @@ "yammer", "yandex", "zoho", - "zoom", - "mock", - "mock-unverified" + "zoom" ], "x-enum-name": "OAuthProvider", "x-enum-keys": [], @@ -3460,7 +3472,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -3591,7 +3604,8 @@ "type": "string", "description": "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.", "default": null, - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" } }, "required": [ @@ -3905,7 +3919,7 @@ "x-appwrite": { "method": "getBrowser", "group": null, - "weight": 50, + "weight": 288, "cookies": false, "type": "location", "demo": "avatars\/get-browser.md", @@ -4033,7 +4047,7 @@ "x-appwrite": { "method": "getCreditCard", "group": null, - "weight": 49, + "weight": 287, "cookies": false, "type": "location", "demo": "avatars\/get-credit-card.md", @@ -4167,7 +4181,7 @@ "x-appwrite": { "method": "getFavicon", "group": null, - "weight": 53, + "weight": 291, "cookies": false, "type": "location", "demo": "avatars\/get-favicon.md", @@ -4233,7 +4247,7 @@ "x-appwrite": { "method": "getFlag", "group": null, - "weight": 51, + "weight": 289, "cookies": false, "type": "location", "demo": "avatars\/get-flag.md", @@ -4723,7 +4737,7 @@ "x-appwrite": { "method": "getImage", "group": null, - "weight": 52, + "weight": 290, "cookies": false, "type": "location", "demo": "avatars\/get-image.md", @@ -4809,7 +4823,7 @@ "x-appwrite": { "method": "getInitials", "group": null, - "weight": 55, + "weight": 293, "cookies": false, "type": "location", "demo": "avatars\/get-initials.md", @@ -4903,7 +4917,7 @@ "x-appwrite": { "method": "getQR", "group": null, - "weight": 54, + "weight": 292, "cookies": false, "type": "location", "demo": "avatars\/get-qr.md", @@ -4997,7 +5011,7 @@ "x-appwrite": { "method": "getScreenshot", "group": null, - "weight": 56, + "weight": 294, "cookies": false, "type": "location", "demo": "avatars\/get-screenshot.md", @@ -6061,7 +6075,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -7809,6 +7824,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -7924,6 +7940,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -8289,6 +8306,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8296,6 +8314,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8303,6 +8322,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -8418,6 +8438,7 @@ "description": "Minimum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -8425,6 +8446,7 @@ "description": "Maximum value.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -8432,6 +8454,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -8547,6 +8570,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -8554,6 +8578,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -8561,6 +8586,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -8676,6 +8702,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -8683,6 +8710,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -8690,6 +8718,7 @@ "description": "Default value. Cannot be set when attribute is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -9839,7 +9868,8 @@ "type": "integer", "description": "Attribute size for text attributes, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -9981,6 +10011,7 @@ "description": "Maximum size of the string attribute.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -10096,6 +10127,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -10211,6 +10243,7 @@ "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -11746,13 +11779,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -11869,13 +11904,15 @@ "type": "number", "description": "Value to increment the attribute by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -12540,7 +12577,8 @@ "type": "integer", "description": "Function maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -13019,7 +13057,8 @@ "type": "integer", "description": "Maximum execution time in seconds.", "default": 15, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "enabled": { "type": "boolean", @@ -14832,7 +14871,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 225, + "weight": 214, "cookies": false, "type": "graphql", "demo": "graphql\/query.md", @@ -14909,7 +14948,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 224, + "weight": 213, "cookies": false, "type": "graphql", "demo": "graphql\/mutation.md", @@ -14984,7 +15023,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 68, + "weight": 57, "cookies": false, "type": "", "demo": "health\/get.md", @@ -15036,7 +15075,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 89, + "weight": 78, "cookies": false, "type": "", "demo": "health\/get-antivirus.md", @@ -15088,7 +15127,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 71, + "weight": 60, "cookies": false, "type": "", "demo": "health\/get-cache.md", @@ -15140,7 +15179,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 76, + "weight": 65, "cookies": false, "type": "", "demo": "health\/get-certificate.md", @@ -15201,7 +15240,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 70, + "weight": 59, "cookies": false, "type": "", "demo": "health\/get-db.md", @@ -15253,7 +15292,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 72, + "weight": 61, "cookies": false, "type": "", "demo": "health\/get-pub-sub.md", @@ -15305,7 +15344,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 78, + "weight": 67, "cookies": false, "type": "", "demo": "health\/get-queue-builds.md", @@ -15368,7 +15407,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 77, + "weight": 66, "cookies": false, "type": "", "demo": "health\/get-queue-certificates.md", @@ -15431,7 +15470,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 79, + "weight": 68, "cookies": false, "type": "", "demo": "health\/get-queue-databases.md", @@ -15503,7 +15542,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 80, + "weight": 69, "cookies": false, "type": "", "demo": "health\/get-queue-deletes.md", @@ -15566,7 +15605,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 90, + "weight": 79, "cookies": false, "type": "", "demo": "health\/get-failed-jobs.md", @@ -15610,6 +15649,7 @@ "v1-webhooks", "v1-certificates", "v1-builds", + "v1-screenshots", "v1-messaging", "v1-migrations" ], @@ -15653,7 +15693,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 84, + "weight": 73, "cookies": false, "type": "", "demo": "health\/get-queue-functions.md", @@ -15716,7 +15756,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 75, + "weight": 64, "cookies": false, "type": "", "demo": "health\/get-queue-logs.md", @@ -15779,7 +15819,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 81, + "weight": 70, "cookies": false, "type": "", "demo": "health\/get-queue-mails.md", @@ -15842,7 +15882,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 82, + "weight": 71, "cookies": false, "type": "", "demo": "health\/get-queue-messaging.md", @@ -15905,7 +15945,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 83, + "weight": 72, "cookies": false, "type": "", "demo": "health\/get-queue-migrations.md", @@ -15968,7 +16008,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 85, + "weight": 74, "cookies": false, "type": "", "demo": "health\/get-queue-stats-resources.md", @@ -16031,7 +16071,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 86, + "weight": 75, "cookies": false, "type": "", "demo": "health\/get-queue-usage.md", @@ -16094,7 +16134,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 74, + "weight": 63, "cookies": false, "type": "", "demo": "health\/get-queue-webhooks.md", @@ -16157,7 +16197,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 88, + "weight": 77, "cookies": false, "type": "", "demo": "health\/get-storage.md", @@ -16209,7 +16249,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 87, + "weight": 76, "cookies": false, "type": "", "demo": "health\/get-storage-local.md", @@ -16261,7 +16301,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 73, + "weight": 62, "cookies": false, "type": "", "demo": "health\/get-time.md", @@ -16313,7 +16353,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 60, + "weight": 49, "cookies": false, "type": "", "demo": "locale\/get.md", @@ -16368,7 +16408,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 61, + "weight": 50, "cookies": false, "type": "", "demo": "locale\/list-codes.md", @@ -16423,7 +16463,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 65, + "weight": 54, "cookies": false, "type": "", "demo": "locale\/list-continents.md", @@ -16478,7 +16518,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 62, + "weight": 51, "cookies": false, "type": "", "demo": "locale\/list-countries.md", @@ -16533,7 +16573,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 63, + "weight": 52, "cookies": false, "type": "", "demo": "locale\/list-countries-eu.md", @@ -16588,7 +16628,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 64, + "weight": 53, "cookies": false, "type": "", "demo": "locale\/list-countries-phones.md", @@ -16643,7 +16683,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 66, + "weight": 55, "cookies": false, "type": "", "demo": "locale\/list-currencies.md", @@ -16698,7 +16738,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 67, + "weight": 56, "cookies": false, "type": "", "demo": "locale\/list-languages.md", @@ -16753,7 +16793,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 280, + "weight": 269, "cookies": false, "type": "", "demo": "messaging\/list-messages.md", @@ -16839,7 +16879,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 277, + "weight": 266, "cookies": false, "type": "", "demo": "messaging\/create-email.md", @@ -17000,7 +17040,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 284, + "weight": 273, "cookies": false, "type": "", "demo": "messaging\/update-email.md", @@ -17168,7 +17208,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 279, + "weight": 268, "cookies": false, "type": "", "demo": "messaging\/create-push.md", @@ -17293,7 +17333,8 @@ "type": "integer", "description": "Badge for push notification. Available only for iOS Platform.", "default": -1, - "x-example": null + "x-example": null, + "format": "int32" }, "draft": { "type": "boolean", @@ -17367,7 +17408,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 286, + "weight": 275, "cookies": false, "type": "", "demo": "messaging\/update-push.md", @@ -17506,6 +17547,7 @@ "description": "Badge for push notification. Available only for iOS platforms.", "default": null, "x-example": null, + "format": "int32", "x-nullable": true }, "draft": { @@ -17581,7 +17623,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 278, + "weight": 267, "cookies": false, "type": "", "demo": "messaging\/create-sms.md", @@ -17774,7 +17816,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 285, + "weight": 274, "cookies": false, "type": "", "demo": "messaging\/update-sms.md", @@ -17966,7 +18008,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 283, + "weight": 272, "cookies": false, "type": "", "demo": "messaging\/get-message.md", @@ -18023,7 +18065,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 287, + "weight": 276, "cookies": false, "type": "", "demo": "messaging\/delete.md", @@ -18085,7 +18127,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 281, + "weight": 270, "cookies": false, "type": "", "demo": "messaging\/list-message-logs.md", @@ -18168,7 +18210,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 282, + "weight": 271, "cookies": false, "type": "", "demo": "messaging\/list-targets.md", @@ -18251,7 +18293,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 251, + "weight": 240, "cookies": false, "type": "", "demo": "messaging\/list-providers.md", @@ -18337,7 +18379,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 250, + "weight": 239, "cookies": false, "type": "", "demo": "messaging\/create-apns-provider.md", @@ -18529,7 +18571,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 264, + "weight": 253, "cookies": false, "type": "", "demo": "messaging\/update-apns-provider.md", @@ -18718,7 +18760,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 249, + "weight": 238, "cookies": false, "type": "", "demo": "messaging\/create-fcm-provider.md", @@ -18879,7 +18921,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 263, + "weight": 252, "cookies": false, "type": "", "demo": "messaging\/update-fcm-provider.md", @@ -19036,7 +19078,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 240, + "weight": 229, "cookies": false, "type": "", "demo": "messaging\/create-mailgun-provider.md", @@ -19110,7 +19152,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19122,7 +19165,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19167,7 +19211,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 254, + "weight": 243, "cookies": false, "type": "", "demo": "messaging\/update-mailgun-provider.md", @@ -19250,7 +19294,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19296,7 +19341,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 244, + "weight": 233, "cookies": false, "type": "", "demo": "messaging\/create-msg-91-provider.md", @@ -19402,7 +19447,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 258, + "weight": 247, "cookies": false, "type": "", "demo": "messaging\/update-msg-91-provider.md", @@ -19506,7 +19551,7 @@ "x-appwrite": { "method": "createResendProvider", "group": "providers", - "weight": 242, + "weight": 231, "cookies": false, "type": "", "demo": "messaging\/create-resend-provider.md", @@ -19567,7 +19612,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19579,7 +19625,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19624,7 +19671,7 @@ "x-appwrite": { "method": "updateResendProvider", "group": "providers", - "weight": 256, + "weight": 245, "cookies": false, "type": "", "demo": "messaging\/update-resend-provider.md", @@ -19694,7 +19741,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19740,7 +19788,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 241, + "weight": 230, "cookies": false, "type": "", "demo": "messaging\/create-sendgrid-provider.md", @@ -19801,7 +19849,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19813,7 +19862,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -19858,7 +19908,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 255, + "weight": 244, "cookies": false, "type": "", "demo": "messaging\/update-sendgrid-provider.md", @@ -19928,7 +19978,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -19974,7 +20025,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 243, + "weight": 232, "cookies": false, "type": "", "demo": "messaging\/create-smtp-provider.md", @@ -20117,7 +20168,8 @@ "type": "integer", "description": "The default SMTP server port.", "default": 587, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "username": { "type": "string", @@ -20166,7 +20218,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20178,7 +20231,8 @@ "type": "string", "description": "Email set in the reply to field for the mail. Default value is sender email.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "enabled": { "type": "boolean", @@ -20224,7 +20278,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 257, + "weight": 246, "cookies": false, "type": "", "demo": "messaging\/update-smtp-provider.md", @@ -20366,6 +20420,7 @@ "description": "SMTP port.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "username": { @@ -20416,7 +20471,8 @@ "type": "string", "description": "Sender email address.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "replyToName": { "type": "string", @@ -20469,7 +20525,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 245, + "weight": 234, "cookies": false, "type": "", "demo": "messaging\/create-telesign-provider.md", @@ -20518,7 +20574,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "customerId": { "type": "string", @@ -20575,7 +20632,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 259, + "weight": 248, "cookies": false, "type": "", "demo": "messaging\/update-telesign-provider.md", @@ -20679,7 +20736,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 246, + "weight": 235, "cookies": false, "type": "", "demo": "messaging\/create-textmagic-provider.md", @@ -20728,7 +20785,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "username": { "type": "string", @@ -20785,7 +20843,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 260, + "weight": 249, "cookies": false, "type": "", "demo": "messaging\/update-textmagic-provider.md", @@ -20889,7 +20947,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 247, + "weight": 236, "cookies": false, "type": "", "demo": "messaging\/create-twilio-provider.md", @@ -20938,7 +20996,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "accountSid": { "type": "string", @@ -20995,7 +21054,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 261, + "weight": 250, "cookies": false, "type": "", "demo": "messaging\/update-twilio-provider.md", @@ -21099,7 +21158,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 248, + "weight": 237, "cookies": false, "type": "", "demo": "messaging\/create-vonage-provider.md", @@ -21148,7 +21207,8 @@ "type": "string", "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "apiKey": { "type": "string", @@ -21205,7 +21265,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 262, + "weight": 251, "cookies": false, "type": "", "demo": "messaging\/update-vonage-provider.md", @@ -21307,7 +21367,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 253, + "weight": 242, "cookies": false, "type": "", "demo": "messaging\/get-provider.md", @@ -21364,7 +21424,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 265, + "weight": 254, "cookies": false, "type": "", "demo": "messaging\/delete-provider.md", @@ -21426,7 +21486,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 252, + "weight": 241, "cookies": false, "type": "", "demo": "messaging\/list-provider-logs.md", @@ -21509,7 +21569,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 274, + "weight": 263, "cookies": false, "type": "", "demo": "messaging\/list-subscriber-logs.md", @@ -21592,7 +21652,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 267, + "weight": 256, "cookies": false, "type": "", "demo": "messaging\/list-topics.md", @@ -21676,7 +21736,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 266, + "weight": 255, "cookies": false, "type": "", "demo": "messaging\/create-topic.md", @@ -21766,7 +21826,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 269, + "weight": 258, "cookies": false, "type": "", "demo": "messaging\/get-topic.md", @@ -21828,7 +21888,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 270, + "weight": 259, "cookies": false, "type": "", "demo": "messaging\/update-topic.md", @@ -21911,7 +21971,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 271, + "weight": 260, "cookies": false, "type": "", "demo": "messaging\/delete-topic.md", @@ -21973,7 +22033,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 268, + "weight": 257, "cookies": false, "type": "", "demo": "messaging\/list-topic-logs.md", @@ -22056,7 +22116,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 273, + "weight": 262, "cookies": false, "type": "", "demo": "messaging\/list-subscribers.md", @@ -22148,7 +22208,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 272, + "weight": 261, "cookies": false, "type": "", "demo": "messaging\/create-subscriber.md", @@ -22238,7 +22298,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 275, + "weight": 264, "cookies": false, "type": "", "demo": "messaging\/get-subscriber.md", @@ -22303,7 +22363,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 276, + "weight": 265, "cookies": false, "type": "", "demo": "messaging\/delete-subscriber.md", @@ -22544,7 +22604,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -22981,7 +23042,8 @@ "type": "integer", "description": "Maximum request time in seconds.", "default": 30, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "installCommand": { "type": "string", @@ -24846,7 +24908,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -25057,7 +25120,8 @@ "type": "integer", "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", "default": {}, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "allowedFileExtensions": { "type": "array", @@ -26274,7 +26338,8 @@ "type": "integer", "description": "Seconds before the transaction expires.", "default": 300, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -27919,6 +27984,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "array": { @@ -28033,6 +28099,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "newKey": { @@ -28395,6 +28462,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -28402,6 +28470,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -28409,6 +28478,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "array": { @@ -28523,6 +28593,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "max": { @@ -28530,6 +28601,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "default": { @@ -28537,6 +28609,7 @@ "description": "Default value. Cannot be set when required.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "newKey": { @@ -28651,6 +28724,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -28658,6 +28732,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -28665,6 +28740,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "array": { @@ -28779,6 +28855,7 @@ "description": "Minimum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "max": { @@ -28786,6 +28863,7 @@ "description": "Maximum value", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "default": { @@ -28793,6 +28871,7 @@ "description": "Default value. Cannot be set when column is required.", "default": null, "x-example": null, + "format": "int64", "x-nullable": true }, "newKey": { @@ -29932,7 +30011,8 @@ "type": "integer", "description": "Column size for text columns, in number of characters.", "default": null, - "x-example": 1 + "x-example": 1, + "format": "int32" }, "required": { "type": "boolean", @@ -30073,6 +30153,7 @@ "description": "Maximum size of the string column.", "default": null, "x-example": 1, + "format": "int32", "x-nullable": true }, "newKey": { @@ -30187,6 +30268,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "array": { @@ -30301,6 +30383,7 @@ "description": "Default value for column when not provided. Cannot be set when column is required.", "default": null, "x-example": "https:\/\/example.com", + "format": "url", "x-nullable": true }, "newKey": { @@ -32196,13 +32279,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "min": { "type": "number", "description": "Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32318,13 +32403,15 @@ "type": "number", "description": "Value to increment the column by. The value must be a number.", "default": 1, - "x-example": null + "x-example": null, + "format": "float" }, "max": { "type": "number", "description": "Maximum value for the column. If the current value is greater than this value, an error will be thrown.", "default": null, "x-example": null, + "format": "float", "x-nullable": true }, "transactionId": { @@ -32364,7 +32451,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 145, + "weight": 134, "cookies": false, "type": "", "demo": "teams\/list.md", @@ -32451,7 +32538,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 144, + "weight": 133, "cookies": false, "type": "", "demo": "teams\/create.md", @@ -32544,7 +32631,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 146, + "weight": 135, "cookies": false, "type": "", "demo": "teams\/get.md", @@ -32609,7 +32696,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 148, + "weight": 137, "cookies": false, "type": "", "demo": "teams\/update-name.md", @@ -32687,7 +32774,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 150, + "weight": 139, "cookies": false, "type": "", "demo": "teams\/delete.md", @@ -32752,7 +32839,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 152, + "weight": 141, "cookies": false, "type": "", "demo": "teams\/list-memberships.md", @@ -32847,7 +32934,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 151, + "weight": 140, "cookies": false, "type": "", "demo": "teams\/create-membership.md", @@ -32895,7 +32982,8 @@ "type": "string", "description": "Email of the new team member.", "default": "", - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "userId": { "type": "string", @@ -32907,7 +32995,8 @@ "type": "string", "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": "", - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" }, "roles": { "type": "array", @@ -32929,7 +33018,8 @@ "type": "string", "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", "default": "", - "x-example": "https:\/\/example.com" + "x-example": "https:\/\/example.com", + "format": "url" }, "name": { "type": "string", @@ -32970,7 +33060,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 153, + "weight": 142, "cookies": false, "type": "", "demo": "teams\/get-membership.md", @@ -33043,7 +33133,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 154, + "weight": 143, "cookies": false, "type": "", "demo": "teams\/update-membership.md", @@ -33139,7 +33229,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 156, + "weight": 145, "cookies": false, "type": "", "demo": "teams\/delete-membership.md", @@ -33214,7 +33304,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 155, + "weight": 144, "cookies": false, "type": "", "demo": "teams\/update-membership-status.md", @@ -33311,7 +33401,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 147, + "weight": 136, "cookies": false, "type": "", "demo": "teams\/get-prefs.md", @@ -33375,7 +33465,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 149, + "weight": 138, "cookies": false, "type": "", "demo": "teams\/update-prefs.md", @@ -33826,7 +33916,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 167, + "weight": 156, "cookies": false, "type": "", "demo": "users\/list.md", @@ -33910,7 +34000,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 158, + "weight": 147, "cookies": false, "type": "", "demo": "users\/create.md", @@ -33954,6 +34044,7 @@ "description": "User email.", "default": null, "x-example": "email@example.com", + "format": "email", "x-nullable": true }, "phone": { @@ -33961,6 +34052,7 @@ "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", "default": null, "x-example": "+12065550100", + "format": "phone", "x-nullable": true }, "password": { @@ -34010,7 +34102,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 161, + "weight": 150, "cookies": false, "type": "", "demo": "users\/create-argon-2-user.md", @@ -34053,13 +34145,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Argon2.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34104,7 +34198,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 159, + "weight": 148, "cookies": false, "type": "", "demo": "users\/create-bcrypt-user.md", @@ -34147,13 +34241,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Bcrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34196,7 +34292,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 175, + "weight": 164, "cookies": false, "type": "", "demo": "users\/list-identities.md", @@ -34277,7 +34373,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 198, + "weight": 187, "cookies": false, "type": "", "demo": "users\/delete-identity.md", @@ -34341,7 +34437,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 160, + "weight": 149, "cookies": false, "type": "", "demo": "users\/create-md-5-user.md", @@ -34384,13 +34480,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using MD5.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34435,7 +34533,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 163, + "weight": 152, "cookies": false, "type": "", "demo": "users\/create-ph-pass-user.md", @@ -34478,13 +34576,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using PHPass.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "name": { "type": "string", @@ -34529,7 +34629,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 164, + "weight": 153, "cookies": false, "type": "", "demo": "users\/create-scrypt-user.md", @@ -34572,13 +34672,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34590,25 +34692,29 @@ "type": "integer", "description": "Optional CPU cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordMemory": { "type": "integer", "description": "Optional memory cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordParallel": { "type": "integer", "description": "Optional parallelization cost used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "passwordLength": { "type": "integer", "description": "Optional hash length used to hash password.", "default": null, - "x-example": null + "x-example": null, + "format": "int32" }, "name": { "type": "string", @@ -34658,7 +34764,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 165, + "weight": 154, "cookies": false, "type": "", "demo": "users\/create-scrypt-modified-user.md", @@ -34701,13 +34807,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using Scrypt Modified.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordSalt": { "type": "string", @@ -34773,7 +34881,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 162, + "weight": 151, "cookies": false, "type": "", "demo": "users\/create-sha-user.md", @@ -34816,13 +34924,15 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" }, "password": { "type": "string", "description": "User password hashed using SHA.", "default": null, - "x-example": "password" + "x-example": "password", + "format": "password" }, "passwordVersion": { "type": "string", @@ -34886,7 +34996,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 168, + "weight": 157, "cookies": false, "type": "", "demo": "users\/get.md", @@ -34943,7 +35053,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 196, + "weight": 185, "cookies": false, "type": "", "demo": "users\/delete.md", @@ -35007,7 +35117,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 181, + "weight": 170, "cookies": false, "type": "", "demo": "users\/update-email.md", @@ -35052,7 +35162,8 @@ "type": "string", "description": "User email.", "default": null, - "x-example": "email@example.com" + "x-example": "email@example.com", + "format": "email" } }, "required": [ @@ -35089,7 +35200,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 199, + "weight": 188, "cookies": false, "type": "", "demo": "users\/create-jwt.md", @@ -35140,7 +35251,8 @@ "type": "integer", "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", "default": 900, - "x-example": 0 + "x-example": 0, + "format": "int32" } } } @@ -35174,7 +35286,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 177, + "weight": 166, "cookies": false, "type": "", "demo": "users\/update-labels.md", @@ -35257,7 +35369,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 173, + "weight": 162, "cookies": false, "type": "", "demo": "users\/list-logs.md", @@ -35340,7 +35452,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 172, + "weight": 161, "cookies": false, "type": "", "demo": "users\/list-memberships.md", @@ -35434,7 +35546,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 186, + "weight": 175, "cookies": false, "type": "", "demo": "users\/update-mfa.md", @@ -35573,7 +35685,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 191, + "weight": 180, "cookies": false, "type": "", "demo": "users\/delete-mfa-authenticator.md", @@ -35708,7 +35820,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 187, + "weight": 176, "cookies": false, "type": "", "demo": "users\/list-mfa-factors.md", @@ -35828,7 +35940,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 188, + "weight": 177, "cookies": false, "type": "", "demo": "users\/get-mfa-recovery-codes.md", @@ -35948,7 +36060,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 190, + "weight": 179, "cookies": false, "type": "", "demo": "users\/update-mfa-recovery-codes.md", @@ -36068,7 +36180,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 189, + "weight": 178, "cookies": false, "type": "", "demo": "users\/create-mfa-recovery-codes.md", @@ -36190,7 +36302,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 179, + "weight": 168, "cookies": false, "type": "", "demo": "users\/update-name.md", @@ -36272,7 +36384,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 180, + "weight": 169, "cookies": false, "type": "", "demo": "users\/update-password.md", @@ -36354,7 +36466,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 182, + "weight": 171, "cookies": false, "type": "", "demo": "users\/update-phone.md", @@ -36399,7 +36511,8 @@ "type": "string", "description": "User phone number.", "default": null, - "x-example": "+12065550100" + "x-example": "+12065550100", + "format": "phone" } }, "required": [ @@ -36434,7 +36547,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 169, + "weight": 158, "cookies": false, "type": "", "demo": "users\/get-prefs.md", @@ -36496,7 +36609,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 184, + "weight": 173, "cookies": false, "type": "", "demo": "users\/update-prefs.md", @@ -36576,7 +36689,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 171, + "weight": 160, "cookies": false, "type": "", "demo": "users\/list-sessions.md", @@ -36647,7 +36760,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 192, + "weight": 181, "cookies": false, "type": "", "demo": "users\/create-session.md", @@ -36704,7 +36817,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 195, + "weight": 184, "cookies": false, "type": "", "demo": "users\/delete-sessions.md", @@ -36763,7 +36876,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 194, + "weight": 183, "cookies": false, "type": "", "demo": "users\/delete-session.md", @@ -36835,7 +36948,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 176, + "weight": 165, "cookies": false, "type": "", "demo": "users\/update-status.md", @@ -36915,7 +37028,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 174, + "weight": 163, "cookies": false, "type": "", "demo": "users\/list-targets.md", @@ -36998,7 +37111,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 166, + "weight": 155, "cookies": false, "type": "", "demo": "users\/create-target.md", @@ -37111,7 +37224,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 170, + "weight": 159, "cookies": false, "type": "", "demo": "users\/get-target.md", @@ -37181,7 +37294,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 185, + "weight": 174, "cookies": false, "type": "", "demo": "users\/update-target.md", @@ -37273,7 +37386,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 197, + "weight": 186, "cookies": false, "type": "", "demo": "users\/delete-target.md", @@ -37345,7 +37458,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 193, + "weight": 182, "cookies": false, "type": "", "demo": "users\/create-token.md", @@ -37390,13 +37503,15 @@ "type": "integer", "description": "Token length in characters. The default length is 6 characters", "default": 6, - "x-example": 4 + "x-example": 4, + "format": "int32" }, "expire": { "type": "integer", "description": "Token expiration period in seconds. The default expiration is 15 minutes.", "default": 900, - "x-example": 60 + "x-example": 60, + "format": "int32" } } } @@ -37430,7 +37545,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 183, + "weight": 172, "cookies": false, "type": "", "demo": "users\/update-email-verification.md", @@ -37512,7 +37627,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 178, + "weight": 167, "cookies": false, "type": "", "demo": "users\/update-phone-verification.md", @@ -39105,14 +39220,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -40555,14 +40670,14 @@ "type": "integer", "description": "Minimum value to enforce for new documents.", "x-example": 1, - "format": "int32", + "format": "int64", "x-nullable": true }, "max": { "type": "integer", "description": "Maximum value to enforce for new documents.", "x-example": 10, - "format": "int32", + "format": "int64", "x-nullable": true }, "default": { @@ -43054,6 +43169,16 @@ "description": "Total number of chunks uploaded", "x-example": 17890, "format": "int32" + }, + "encryption": { + "type": "boolean", + "description": "Whether file contents are encrypted at rest.", + "x-example": true + }, + "compression": { + "type": "string", + "description": "Compression algorithm used for the file. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" } }, "required": [ @@ -43067,7 +43192,9 @@ "mimeType", "sizeOriginal", "chunksTotal", - "chunksUploaded" + "chunksUploaded", + "encryption", + "compression" ], "example": { "$id": "5e5ea5c16897e", @@ -43082,7 +43209,9 @@ "mimeType": "image\/png", "sizeOriginal": 17890, "chunksTotal": 17890, - "chunksUploaded": 17890 + "chunksUploaded": 17890, + "encryption": true, + "compression": "gzip" } }, "bucket": { @@ -45232,7 +45361,7 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "x-example": "processing", "enum": [ "draft", "processing", @@ -45278,7 +45407,7 @@ "subject": "Welcome to Appwrite", "content": "Hi there, welcome to Appwrite family." }, - "status": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "status": "processing" } }, "topic": { diff --git a/app/config/storage/resource_limits.php b/app/config/storage/resource_limits.php index cfbcea5a47..43ed2b8b05 100644 --- a/app/config/storage/resource_limits.php +++ b/app/config/storage/resource_limits.php @@ -3,4 +3,6 @@ use Utopia\Image\Image; use Utopia\System\System; -Image::setResourceLimit('memory', intval(System::getEnv('_APP_IMAGES_RESOURCE_LIMIT_MEMORY', 1024*1024*64))); +if (\class_exists('Imagick')) { + Image::setResourceLimit('memory', intval(System::getEnv('_APP_IMAGES_RESOURCE_LIMIT_MEMORY', 1024*1024*64))); +} diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 2c481b500c..bcea3387a2 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -207,10 +207,10 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, arr } -$createSession = function (string $userId, string $secret, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Reader $geodb, Event $queueForEvents, Mail $queueForMails, Store $store, ProofsToken $proofForToken, ProofsCode $proofForCode) { +$createSession = function (string $userId, string $secret, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Reader $geodb, Event $queueForEvents, Mail $queueForMails, Store $store, ProofsToken $proofForToken, ProofsCode $proofForCode, Authorization $authorization) { /** @var Appwrite\Utopia\Database\Documents\User $userFromRequest */ - $userFromRequest = Authorization::skip(fn () => $dbForProject->getDocument('users', $userId)); + $userFromRequest = $authorization->skip(fn () => $dbForProject->getDocument('users', $userId)); if ($userFromRequest->isEmpty()) { throw new Exception(Exception::USER_INVALID_TOKEN); @@ -266,7 +266,7 @@ $createSession = function (string $userId, string $secret, Request $request, Res $detector->getDevice() )); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $session = $dbForProject->createDocument('sessions', $session ->setAttribute('$permissions', [ @@ -275,7 +275,7 @@ $createSession = function (string $userId, string $secret, Request $request, Res Permission::delete(Role::user($user->getId())), ])); - Authorization::skip(fn () => $dbForProject->deleteDocument('tokens', $verifiedToken->getId())); + $authorization->skip(fn () => $dbForProject->deleteDocument('tokens', $verifiedToken->getId())); $dbForProject->purgeCachedDocument('users', $user->getId()); // Magic URL + Email OTP @@ -376,8 +376,9 @@ App::post('/v1/account') ->inject('user') ->inject('project') ->inject('dbForProject') + ->inject('authorization') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Hooks $hooks) { + ->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Authorization $authorization, Hooks $hooks) { $email = \strtolower($email); if ('console' === $project->getId()) { @@ -469,9 +470,9 @@ App::post('/v1/account') ]); $user->removeAttribute('$sequence'); - $user = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); try { - $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ + $target = $authorization->skip(fn () => $dbForProject->createDocument('targets', new Document([ '$permissions' => [ Permission::read(Role::user($user->getId())), Permission::update(Role::user($user->getId())), @@ -497,9 +498,9 @@ App::post('/v1/account') throw new Exception(Exception::USER_ALREADY_EXISTS); } - Authorization::unsetRole(Role::guests()->toString()); - Authorization::setRole(Role::user($user->getId())->toString()); - Authorization::setRole(Role::users()->toString()); + $authorization->removeRole(Role::guests()->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::users()->toString()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -976,7 +977,8 @@ App::post('/v1/account/sessions/email') ->inject('store') ->inject('proofForPassword') ->inject('proofForToken') - ->action(function (string $email, string $password, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Reader $geodb, Event $queueForEvents, Mail $queueForMails, Hooks $hooks, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (string $email, string $password, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Reader $geodb, Event $queueForEvents, Mail $queueForMails, Hooks $hooks, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken, Authorization $authorization) { $email = \strtolower($email); $protocol = $request->getProtocol(); @@ -1021,7 +1023,7 @@ App::post('/v1/account/sessions/email') $detector->getDevice() )); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); // Re-hash if not using recommended algo if ($user->getAttribute('hash') !== $proofForPassword->getHash()->getName()) { @@ -1120,7 +1122,8 @@ App::post('/v1/account/sessions/anonymous') ->inject('store') ->inject('proofForPassword') ->inject('proofForToken') - ->action(function (Request $request, Response $response, Locale $locale, User $user, Document $project, Database $dbForProject, Reader $geodb, Event $queueForEvents, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (Request $request, Response $response, Locale $locale, User $user, Document $project, Database $dbForProject, Reader $geodb, Event $queueForEvents, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken, Authorization $authorization) { $protocol = $request->getProtocol(); if ('console' === $project->getId()) { @@ -1165,7 +1168,7 @@ App::post('/v1/account/sessions/anonymous') 'accessedAt' => DateTime::now(), ]); $user->removeAttribute('$sequence'); - Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); // Create session token $duration = $project->getAttribute('auths', [])['duration'] ?? TOKEN_EXPIRATION_LOGIN_LONG; @@ -1191,7 +1194,7 @@ App::post('/v1/account/sessions/anonymous') $detector->getDevice() )); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $session = $dbForProject->createDocument('sessions', $session->setAttribute('$permissions', [ Permission::read(Role::user($user->getId())), @@ -1274,6 +1277,7 @@ App::post('/v1/account/sessions/token') ->inject('store') ->inject('proofForToken') ->inject('proofForCode') +->inject('authorization') ->action($createSession); App::get('/v1/account/sessions/oauth2/:provider') @@ -1470,7 +1474,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('store') ->inject('proofForPassword') ->inject('proofForToken') - ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Validator $redirectValidator, Document $devKey, User $user, Database $dbForProject, Reader $geodb, Event $queueForEvents, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken) use ($oauthDefaultSuccess) { + ->inject('authorization') + ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Validator $redirectValidator, Document $devKey, User $user, Database $dbForProject, Reader $geodb, Event $queueForEvents, Store $store, ProofsPassword $proofForPassword, ProofsToken $proofForToken, Authorization $authorization) use ($oauthDefaultSuccess) { $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $port = $request->getPort(); $callbackBase = $protocol . '://' . $request->getHostname(); @@ -1726,7 +1731,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ]); $user->removeAttribute('$sequence'); - $userDoc = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $userDoc = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); $dbForProject->createDocument('targets', new Document([ '$permissions' => [ Permission::read(Role::user($user->getId())), @@ -1744,8 +1749,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') } } - Authorization::setRole(Role::user($user->getId())->toString()); - Authorization::setRole(Role::users()->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::users()->toString()); if (false === $user->getAttribute('status')) { // Account is blocked $failureRedirect(Exception::USER_BLOCKED); // User is in status blocked @@ -1816,7 +1821,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $dbForProject->updateDocument('users', $user->getId(), $user); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $state['success'] = URLParser::parse($state['success']); $query = URLParser::parseQuery($state['success']['query']); @@ -1840,7 +1845,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $token = $dbForProject->createDocument('tokens', $token ->setAttribute('$permissions', [ @@ -2077,7 +2082,8 @@ App::post('/v1/account/tokens/magic-url') ->inject('queueForMails') ->inject('proofForPassword') ->inject('platform') - ->action(function (string $userId, string $email, string $url, bool $phrase, Request $request, Response $response, User $user, Document $project, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsPassword $proofForPassword, array $platform) { + ->inject('authorization') + ->action(function (string $userId, string $email, string $url, bool $phrase, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsPassword $proofForPassword, array $platform, Authorization $authorization) { if (empty(System::getEnv('_APP_SMTP_HOST'))) { throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP disabled'); } @@ -2150,7 +2156,7 @@ App::post('/v1/account/tokens/magic-url') ]); $user->removeAttribute('$sequence'); - Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); } $proofForToken = new ProofsToken(TOKEN_LENGTH_MAGIC_URL); @@ -2170,7 +2176,7 @@ App::post('/v1/account/tokens/magic-url') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $token = $dbForProject->createDocument('tokens', $token ->setAttribute('$permissions', [ @@ -2356,7 +2362,8 @@ App::post('/v1/account/tokens/email') ->inject('queueForMails') ->inject('proofForPassword') ->inject('proofForCode') - ->action(function (string $userId, string $email, bool $phrase, Request $request, Response $response, User $user, Document $project, array $platform, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsPassword $proofForPassword, ProofsCode $proofForCode) { + ->inject('authorization') + ->action(function (string $userId, string $email, bool $phrase, Request $request, Response $response, User $user, Document $project, array $platform, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsPassword $proofForPassword, ProofsCode $proofForCode, Authorization $authorization) { if (empty(System::getEnv('_APP_SMTP_HOST'))) { throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP disabled'); } @@ -2425,9 +2432,9 @@ App::post('/v1/account/tokens/email') ]); $user->removeAttribute('$sequence'); - $user = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); try { - $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ + $target = $authorization->skip(fn () => $dbForProject->createDocument('targets', new Document([ '$permissions' => [ Permission::read(Role::user($user->getId())), Permission::update(Role::user($user->getId())), @@ -2465,7 +2472,7 @@ App::post('/v1/account/tokens/email') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $token = $dbForProject->createDocument('tokens', $token ->setAttribute('$permissions', [ @@ -2662,10 +2669,11 @@ App::put('/v1/account/sessions/magic-url') ->inject('queueForMails') ->inject('store') ->inject('proofForCode') - ->action(function ($userId, $secret, $request, $response, $user, $dbForProject, $project, $platform, $locale, $geodb, $queueForEvents, $queueForMails, $store, $proofForCode) use ($createSession) { + ->inject('authorization') + ->action(function ($userId, $secret, $request, $response, $user, $dbForProject, $project, $platform, $locale, $geodb, $queueForEvents, $queueForMails, $store, $proofForCode, $authorization) use ($createSession) { $proofForToken = new ProofsToken(TOKEN_LENGTH_MAGIC_URL); $proofForToken->setHash(new Sha()); - $createSession($userId, $secret, $request, $response, $user, $dbForProject, $project, $platform, $locale, $geodb, $queueForEvents, $queueForMails, $store, $proofForToken, $proofForCode); + $createSession($userId, $secret, $request, $response, $user, $dbForProject, $project, $platform, $locale, $geodb, $queueForEvents, $queueForMails, $store, $proofForToken, $proofForCode, $authorization); }); App::put('/v1/account/sessions/phone') @@ -2711,6 +2719,7 @@ App::put('/v1/account/sessions/phone') ->inject('store') ->inject('proofForToken') ->inject('proofForCode') + ->inject('authorization') ->action($createSession); App::post('/v1/account/tokens/phone') @@ -2754,7 +2763,8 @@ App::post('/v1/account/tokens/phone') ->inject('plan') ->inject('store') ->inject('proofForCode') - ->action(function (string $userId, string $phone, Request $request, Response $response, User $user, Document $project, array $platform, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Locale $locale, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, Store $store, ProofsCode $proofForCode) { + ->inject('authorization') + ->action(function (string $userId, string $phone, Request $request, Response $response, User $user, Document $project, array $platform, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Locale $locale, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, Store $store, ProofsCode $proofForCode, Authorization $authorization) { if (empty(System::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured'); } @@ -2804,9 +2814,9 @@ App::post('/v1/account/tokens/phone') ]); $user->removeAttribute('$sequence'); - Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); + $user = $authorization->skip(fn () => $dbForProject->createDocument('users', $user)); try { - $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ + $target = $authorization->skip(fn () => $dbForProject->createDocument('targets', new Document([ '$permissions' => [ Permission::read(Role::user($user->getId())), Permission::update(Role::user($user->getId())), @@ -2852,7 +2862,7 @@ App::post('/v1/account/tokens/phone') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $token = $dbForProject->createDocument('tokens', $token ->setAttribute('$permissions', [ @@ -3243,7 +3253,8 @@ App::patch('/v1/account/email') ->inject('project') ->inject('hooks') ->inject('proofForPassword') - ->action(function (string $email, string $password, ?\DateTime $requestTimestamp, Response $response, User $user, Database $dbForProject, Event $queueForEvents, Document $project, Hooks $hooks, ProofsPassword $proofForPassword) { + ->inject('authorization') + ->action(function (string $email, string $password, ?\DateTime $requestTimestamp, Response $response, User $user, Database $dbForProject, Event $queueForEvents, Document $project, Hooks $hooks, ProofsPassword $proofForPassword, Authorization $authorization) { // passwordUpdate will be empty if the user has never set a password $passwordUpdate = $user->getAttribute('passwordUpdate'); @@ -3295,7 +3306,7 @@ App::patch('/v1/account/email') ->setAttribute('passwordUpdate', DateTime::now()); } - $target = Authorization::skip(fn () => $dbForProject->findOne('targets', [ + $target = $authorization->skip(fn () => $dbForProject->findOne('targets', [ Query::equal('identifier', [$email]), ])); @@ -3311,7 +3322,7 @@ App::patch('/v1/account/email') $oldTarget = $user->find('identifier', $oldEmail, 'targets'); if ($oldTarget instanceof Document && !$oldTarget->isEmpty()) { - Authorization::skip(fn () => $dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $email))); + $authorization->skip(fn () => $dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $email))); } $dbForProject->purgeCachedDocument('users', $user->getId()); } catch (Duplicate) { @@ -3352,8 +3363,9 @@ App::patch('/v1/account/phone') ->inject('queueForEvents') ->inject('project') ->inject('hooks') - ->inject('proofForPassword') - ->action(function (string $phone, string $password, Response $response, User $user, Database $dbForProject, Event $queueForEvents, Document $project, Hooks $hooks, ProofsPassword $proofForPassword) { + ->inject('proofForPassword') +->inject('authorization') + ->action(function (string $phone, string $password, Response $response, Document $user, Database $dbForProject, Event $queueForEvents, Document $project, Hooks $hooks, ProofsPassword $proofForPassword, Authorization $authorization) { // passwordUpdate will be empty if the user has never set a password $passwordUpdate = $user->getAttribute('passwordUpdate'); @@ -3368,7 +3380,7 @@ App::patch('/v1/account/phone') $hooks->trigger('passwordValidator', [$dbForProject, $project, $password, &$user, false]); - $target = Authorization::skip(fn () => $dbForProject->findOne('targets', [ + $target = $authorization->skip(fn () => $dbForProject->findOne('targets', [ Query::equal('identifier', [$phone]), ])); @@ -3399,7 +3411,7 @@ App::patch('/v1/account/phone') $oldTarget = $user->find('identifier', $oldPhone, 'targets'); if ($oldTarget instanceof Document && !$oldTarget->isEmpty()) { - Authorization::skip(fn () => $dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $phone))); + $authorization->skip(fn () => $dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $phone))); } $dbForProject->purgeCachedDocument('users', $user->getId()); } catch (Duplicate $th) { @@ -3535,7 +3547,9 @@ App::post('/v1/account/recovery') ->inject('queueForMails') ->inject('queueForEvents') ->inject('proofForToken') - ->action(function (string $email, string $url, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Mail $queueForMails, Event $queueForEvents, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (string $email, string $url, Request $request, Response $response, User $user, Database $dbForProject, Document $project, array $platform, Locale $locale, Mail $queueForMails, Event $queueForEvents, ProofsToken $proofForToken, Authorization $authorization) { + if (empty(System::getEnv('_APP_SMTP_HOST'))) { throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled'); } @@ -3571,7 +3585,7 @@ App::post('/v1/account/recovery') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($profile->getId())->toString()); + $authorization->addRole(Role::user($profile->getId())->toString()); $recovery = $dbForProject->createDocument('tokens', $recovery ->setAttribute('$permissions', [ @@ -3727,7 +3741,8 @@ App::put('/v1/account/recovery') ->inject('hooks') ->inject('proofForPassword') ->inject('proofForToken') - ->action(function (string $userId, string $secret, string $password, Response $response, User $user, Database $dbForProject, Document $project, Event $queueForEvents, Hooks $hooks, ProofsPassword $proofForPassword, ProofsToken $proofForToken) { +->inject('authorization') + ->action(function (string $userId, string $secret, string $password, Response $response, User $user, Database $dbForProject, Document $project, Event $queueForEvents, Hooks $hooks, ProofsPassword $proofForPassword, ProofsToken $proofForToken, Authorization $authorization) { /** @var Appwrite\Utopia\Database\Documents\User $profile */ $profile = $dbForProject->getDocument('users', $userId); @@ -3741,7 +3756,7 @@ App::put('/v1/account/recovery') throw new Exception(Exception::USER_INVALID_TOKEN); } - Authorization::setRole(Role::user($profile->getId())->toString()); + $authorization->addRole(Role::user($profile->getId())->toString()); $newPassword = $proofForPassword->hash($password); @@ -3844,7 +3859,8 @@ App::post('/v1/account/verifications/email') ->inject('queueForEvents') ->inject('queueForMails') ->inject('proofForToken') - ->action(function (string $url, Request $request, Response $response, Document $project, array $platform, User $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (string $url, Request $request, Response $response, Document $project, array $platform, User $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Mail $queueForMails, ProofsToken $proofForToken, Authorization $authorization) { if (empty(System::getEnv('_APP_SMTP_HOST'))) { throw new Exception(Exception::GENERAL_SMTP_DISABLED, 'SMTP Disabled'); @@ -3873,7 +3889,7 @@ App::post('/v1/account/verifications/email') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $verification = $dbForProject->createDocument('tokens', $verification ->setAttribute('$permissions', [ @@ -4072,9 +4088,10 @@ App::put('/v1/account/verifications/email') ->inject('dbForProject') ->inject('queueForEvents') ->inject('proofForToken') - ->action(function (string $userId, string $secret, Response $response, User $user, Database $dbForProject, Event $queueForEvents, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (string $userId, string $secret, Response $response, User $user, Database $dbForProject, Event $queueForEvents, ProofsToken $proofForToken, Authorization $authorization) { /** @var Appwrite\Utopia\Database\Documents\User $profile */ - $profile = Authorization::skip(fn () => $dbForProject->getDocument('users', $userId)); + $profile = $authorization->skip(fn () => $dbForProject->getDocument('users', $userId)); if ($profile->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); @@ -4086,7 +4103,7 @@ App::put('/v1/account/verifications/email') throw new Exception(Exception::USER_INVALID_TOKEN); } - Authorization::setRole(Role::user($profile->getId())->toString()); + $authorization->addRole(Role::user($profile->getId())->toString()); $profile = $dbForProject->updateDocument('users', $profile->getId(), $profile->setAttribute('emailVerification', true)); @@ -4146,7 +4163,8 @@ App::post('/v1/account/verifications/phone') ->inject('queueForStatsUsage') ->inject('plan') ->inject('proofForCode') - ->action(function (Request $request, Response $response, User $user, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Document $project, Locale $locale, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, ProofsCode $proofForCode) { + ->inject('authorization') + ->action(function (Request $request, Response $response, User $user, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Document $project, Locale $locale, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, ProofsCode $proofForCode, Authorization $authorization) { if (empty(System::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured'); } @@ -4185,7 +4203,7 @@ App::post('/v1/account/verifications/phone') 'ip' => $request->getIP(), ]); - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $verification = $dbForProject->createDocument('tokens', $verification ->setAttribute('$permissions', [ @@ -4291,9 +4309,10 @@ App::put('/v1/account/verifications/phone') ->inject('dbForProject') ->inject('queueForEvents') ->inject('proofForCode') - ->action(function (string $userId, string $secret, Response $response, User $user, Database $dbForProject, Event $queueForEvents, ProofsCode $proofForCode) { + ->inject('authorization') + ->action(function (string $userId, string $secret, Response $response, User $user, Database $dbForProject, Event $queueForEvents, ProofsCode $proofForCode, Authorization $authorization) { /** @var Appwrite\Utopia\Database\Documents\User $profile */ - $profile = Authorization::skip(fn () => $dbForProject->getDocument('users', $userId)); + $profile = $authorization->skip(fn () => $dbForProject->getDocument('users', $userId)); if ($profile->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); @@ -4305,7 +4324,7 @@ App::put('/v1/account/verifications/phone') throw new Exception(Exception::USER_INVALID_TOKEN); } - Authorization::setRole(Role::user($profile->getId())->toString()); + $authorization->addRole(Role::user($profile->getId())->toString()); $profile = $dbForProject->updateDocument('users', $profile->getId(), $profile->setAttribute('phoneVerification', true)); @@ -4358,12 +4377,13 @@ App::post('/v1/account/targets/push') ->inject('dbForProject') ->inject('store') ->inject('proofForToken') - ->action(function (string $targetId, string $identifier, string $providerId, Event $queueForEvents, User $user, Request $request, Response $response, Database $dbForProject, Store $store, ProofsToken $proofForToken) { + ->inject('authorization') + ->action(function (string $targetId, string $identifier, string $providerId, Event $queueForEvents, User $user, Request $request, Response $response, Database $dbForProject, Store $store, ProofsToken $proofForToken, Authorization $authorization) { $targetId = $targetId == 'unique()' ? ID::unique() : $targetId; - $provider = Authorization::skip(fn () => $dbForProject->getDocument('providers', $providerId)); + $provider = $authorization->skip(fn () => $dbForProject->getDocument('providers', $providerId)); - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $targetId)); + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $targetId)); if (!$target->isEmpty()) { throw new Exception(Exception::USER_TARGET_ALREADY_EXISTS); @@ -4438,9 +4458,10 @@ App::put('/v1/account/targets/:targetId/push') ->inject('request') ->inject('response') ->inject('dbForProject') - ->action(function (string $targetId, string $identifier, Event $queueForEvents, Document $user, Request $request, Response $response, Database $dbForProject) { + ->inject('authorization') + ->action(function (string $targetId, string $identifier, Event $queueForEvents, Document $user, Request $request, Response $response, Database $dbForProject, Authorization $authorization) { - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $targetId)); + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $targetId)); if ($target->isEmpty()) { throw new Exception(Exception::USER_TARGET_NOT_FOUND); @@ -4503,8 +4524,9 @@ App::delete('/v1/account/targets/:targetId/push') ->inject('request') ->inject('response') ->inject('dbForProject') - ->action(function (string $targetId, Event $queueForEvents, Delete $queueForDeletes, Document $user, Request $request, Response $response, Database $dbForProject) { - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $targetId)); + ->inject('authorization') + ->action(function (string $targetId, Event $queueForEvents, Delete $queueForDeletes, Document $user, Request $request, Response $response, Database $dbForProject, Authorization $authorization) { + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $targetId)); if ($target->isEmpty()) { throw new Exception(Exception::USER_TARGET_NOT_FOUND); diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index baf0ba1512..e0cc4181db 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -28,11 +28,12 @@ use Utopia\Validator\Text; App::init() ->groups(['graphql']) ->inject('project') - ->action(function (Document $project) { + ->inject('authorization') + ->action(function (Document $project, Authorization $authorization) { if ( array_key_exists('graphql', $project->getAttribute('apis', [])) && !$project->getAttribute('apis', [])['graphql'] - && !(User::isPrivileged(Authorization::getRoles()) || User::isApp(Authorization::getRoles())) + && !(User::isPrivileged($authorization->getRoles()) || User::isApp($authorization->getRoles())) ) { throw new AppwriteException(AppwriteException::GENERAL_API_DISABLED); } diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 0b6a314dc5..6ac36fe3c0 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -36,6 +36,7 @@ use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Helpers\ID; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Queries; use Utopia\Database\Validator\Query\Cursor; @@ -1073,8 +1074,9 @@ App::get('/v1/messaging/providers') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) { + ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Authorization $authorization, Response $response) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -1100,7 +1102,7 @@ App::get('/v1/messaging/providers') } $providerId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('providers', $providerId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('providers', $providerId)); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Provider '{$providerId}' for the 'cursor' value not found."); @@ -2481,8 +2483,9 @@ App::get('/v1/messaging/topics') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) { + ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Authorization $authorization, Response $response) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -2508,7 +2511,7 @@ App::get('/v1/messaging/topics') } $topicId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('topics', $topicId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId)); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Topic '{$topicId}' for the 'cursor' value not found."); @@ -2782,29 +2785,27 @@ App::post('/v1/messaging/topics/:topicId/subscribers') ->param('targetId', '', new UID(), 'Target ID. The target ID to link to the specified Topic ID.') ->inject('queueForEvents') ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (string $subscriberId, string $topicId, string $targetId, Event $queueForEvents, Database $dbForProject, Response $response) { + ->action(function (string $subscriberId, string $topicId, string $targetId, Event $queueForEvents, Database $dbForProject, Authorization $authorization, Response $response) { $subscriberId = $subscriberId == 'unique()' ? ID::unique() : $subscriberId; - $topic = Authorization::skip(fn () => $dbForProject->getDocument('topics', $topicId)); + $topic = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId)); if ($topic->isEmpty()) { throw new Exception(Exception::TOPIC_NOT_FOUND); } - - $validator = new Authorization('subscribe'); - - if (!$validator->isValid($topic->getAttribute('subscribe'))) { - throw new Exception(Exception::USER_UNAUTHORIZED, $validator->getDescription()); + if (!$authorization->isValid(new Input('subscribe', $topic->getAttribute('subscribe')))) { + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $targetId)); + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $targetId)); if ($target->isEmpty()) { throw new Exception(Exception::USER_TARGET_NOT_FOUND); } - $user = Authorization::skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); + $user = $authorization->skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); $subscriber = new Document([ '$id' => $subscriberId, @@ -2837,7 +2838,7 @@ App::post('/v1/messaging/topics/:topicId/subscribers') default => throw new Exception(Exception::TARGET_PROVIDER_INVALID_TYPE), }; - Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute( + $authorization->skip(fn () => $dbForProject->increaseDocumentAttribute( 'topics', $topicId, $totalAttribute, @@ -2882,8 +2883,9 @@ App::get('/v1/messaging/topics/:topicId/subscribers') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (string $topicId, array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) { + ->action(function (string $topicId, array $queries, string $search, bool $includeTotal, Database $dbForProject, Authorization $authorization, Response $response) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -2894,7 +2896,7 @@ App::get('/v1/messaging/topics/:topicId/subscribers') $queries[] = Query::search('search', $search); } - $topic = Authorization::skip(fn () => $dbForProject->getDocument('topics', $topicId)); + $topic = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId)); if ($topic->isEmpty()) { throw new Exception(Exception::TOPIC_NOT_FOUND); @@ -2917,7 +2919,7 @@ App::get('/v1/messaging/topics/:topicId/subscribers') } $subscriberId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('subscribers', $subscriberId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('subscribers', $subscriberId)); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Subscriber '{$subscriberId}' for the 'cursor' value not found."); @@ -2931,10 +2933,10 @@ App::get('/v1/messaging/topics/:topicId/subscribers') 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."); } - $subscribers = batch(\array_map(function (Document $subscriber) use ($dbForProject) { - return function () use ($subscriber, $dbForProject) { - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $subscriber->getAttribute('targetId'))); - $user = Authorization::skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); + $subscribers = batch(\array_map(function (Document $subscriber) use ($dbForProject, $authorization) { + return function () use ($subscriber, $dbForProject, $authorization) { + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $subscriber->getAttribute('targetId'))); + $user = $authorization->skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); return $subscriber ->setAttribute('target', $target) @@ -3067,9 +3069,10 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (string $topicId, string $subscriberId, Database $dbForProject, Response $response) { - $topic = Authorization::skip(fn () => $dbForProject->getDocument('topics', $topicId)); + ->action(function (string $topicId, string $subscriberId, Database $dbForProject, Authorization $authorization, Response $response) { + $topic = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId)); if ($topic->isEmpty()) { throw new Exception(Exception::TOPIC_NOT_FOUND); @@ -3081,8 +3084,8 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') throw new Exception(Exception::SUBSCRIBER_NOT_FOUND); } - $target = Authorization::skip(fn () => $dbForProject->getDocument('targets', $subscriber->getAttribute('targetId'))); - $user = Authorization::skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); + $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $subscriber->getAttribute('targetId'))); + $user = $authorization->skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId'))); $subscriber ->setAttribute('target', $target) @@ -3118,9 +3121,10 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('queueForEvents') ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (string $topicId, string $subscriberId, Event $queueForEvents, Database $dbForProject, Response $response) { - $topic = Authorization::skip(fn () => $dbForProject->getDocument('topics', $topicId)); + ->action(function (string $topicId, string $subscriberId, Event $queueForEvents, Database $dbForProject, Authorization $authorization, Response $response) { + $topic = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId)); if ($topic->isEmpty()) { throw new Exception(Exception::TOPIC_NOT_FOUND); @@ -3143,7 +3147,7 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') default => throw new Exception(Exception::TARGET_PROVIDER_INVALID_TYPE), }; - Authorization::skip(fn () => $dbForProject->decreaseDocumentAttribute( + $authorization->skip(fn () => $dbForProject->decreaseDocumentAttribute( 'topics', $topicId, $totalAttribute, @@ -3702,8 +3706,9 @@ App::get('/v1/messaging/messages') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('dbForProject') + ->inject('authorization') ->inject('response') - ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Response $response) { + ->action(function (array $queries, string $search, bool $includeTotal, Database $dbForProject, Authorization $authorization, Response $response) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -3729,7 +3734,7 @@ App::get('/v1/messaging/messages') } $messageId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('messages', $messageId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('messages', $messageId)); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Message '{$messageId}' for the 'cursor' value not found."); diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 3989ad3298..1a17853577 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -342,6 +342,7 @@ App::post('/v1/migrations/csv/imports') ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') + ->inject('authorization') ->inject('project') ->inject('platform') ->inject('deviceForFiles') @@ -356,6 +357,7 @@ App::post('/v1/migrations/csv/imports') Response $response, Database $dbForProject, Database $dbForPlatform, + Authorization $authorization, Document $project, array $platform, Device $deviceForFiles, @@ -363,7 +365,7 @@ App::post('/v1/migrations/csv/imports') Event $queueForEvents, Migration $queueForMigrations ) { - $bucket = Authorization::skip(function () use ($internalFile, $dbForPlatform, $dbForProject, $bucketId) { + $bucket = $authorization->skip(function () use ($internalFile, $dbForPlatform, $dbForProject, $bucketId) { if ($internalFile) { return $dbForPlatform->getDocument('buckets', 'default'); } @@ -374,7 +376,7 @@ App::post('/v1/migrations/csv/imports') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = Authorization::skip(fn () => $internalFile ? $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $fileId) : $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $internalFile ? $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $fileId) : $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } @@ -491,6 +493,7 @@ App::post('/v1/migrations/csv/exports') ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') + ->inject('authorization') ->inject('project') ->inject('platform') ->inject('queueForEvents') @@ -509,6 +512,7 @@ App::post('/v1/migrations/csv/exports') Response $response, Database $dbForProject, Database $dbForPlatform, + Authorization $authorization, Document $project, array $platform, Event $queueForEvents, @@ -520,7 +524,7 @@ App::post('/v1/migrations/csv/exports') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $bucket = Authorization::skip(fn () => $dbForPlatform->getDocument('buckets', 'default')); + $bucket = $authorization->skip(fn () => $dbForPlatform->getDocument('buckets', 'default')); if ($bucket->isEmpty()) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } @@ -533,12 +537,12 @@ App::post('/v1/migrations/csv/exports') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index a57675d3e8..cda03f923a 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -45,9 +45,10 @@ App::get('/v1/project/usage') ->inject('response') ->inject('project') ->inject('dbForProject') + ->inject('authorization') ->inject('getLogsDB') ->inject('smsRates') - ->action(function (string $startDate, string $endDate, string $period, Response $response, Document $project, Database $dbForProject, callable $getLogsDB, array $smsRates) { + ->action(function (string $startDate, string $endDate, string $period, Response $response, Document $project, Database $dbForProject, Authorization $authorization, callable $getLogsDB, array $smsRates) { $stats = $total = $usage = []; $format = 'Y-m-d 00:00:00'; $firstDay = (new DateTime($startDate))->format($format); @@ -102,7 +103,7 @@ App::get('/v1/project/usage') '1d' => 'Y-m-d\T00:00:00.000P', }; - Authorization::skip(function () use ($dbForProject, $dbForLogs, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) { + $authorization->skip(function () use ($dbForProject, $dbForLogs, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) { foreach ($metrics['total'] as $metric) { $db = ($metric === METRIC_FILES_IMAGES_TRANSFORMED) ? $dbForLogs : $dbForProject; @@ -286,7 +287,7 @@ App::get('/v1/project/usage') }, $dbForProject->find('functions')); // This total is includes free and paid SMS usage - $authPhoneTotal = Authorization::skip(fn () => $dbForProject->sum('stats', 'value', [ + $authPhoneTotal = $authorization->skip(fn () => $dbForProject->sum('stats', 'value', [ Query::equal('metric', [METRIC_AUTH_METHOD_PHONE]), Query::equal('period', ['1d']), Query::greaterThanEqual('time', $firstDay), @@ -294,7 +295,7 @@ App::get('/v1/project/usage') ])); // This estimate is only for paid SMS usage - $authPhoneMetrics = Authorization::skip(fn () => $dbForProject->find('stats', [ + $authPhoneMetrics = $authorization->skip(fn () => $dbForProject->find('stats', [ Query::startsWith('metric', METRIC_AUTH_METHOD_PHONE . '.'), Query::equal('period', ['1d']), Query::greaterThanEqual('time', $firstDay), diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 74f734a856..b0493ff38f 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -227,6 +227,7 @@ App::post('/v1/projects') if (!$sharedTablesV2) { $adapter = new DatabasePool($pools->get($dsn->getHost())); $dbForProject = new Database($adapter, $cache); + $dbForProject->setDatabase(APP_DATABASE); if ($sharedTables) { $dbForProject diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 1f8555b6cd..aa67a90885 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -86,16 +86,17 @@ App::post('/v1/teams') ->inject('response') ->inject('user') ->inject('dbForProject') + ->inject('authorization') ->inject('queueForEvents') - ->action(function (string $teamId, string $name, array $roles, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $teamId, string $name, array $roles, Response $response, Document $user, Database $dbForProject, Authorization $authorization, Event $queueForEvents) { - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); - $isAppUser = User::isApp(Authorization::getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); + $isAppUser = User::isApp($authorization->getRoles()); $teamId = $teamId == 'unique()' ? ID::unique() : $teamId; try { - $team = Authorization::skip(fn () => $dbForProject->createDocument('teams', new Document([ + $team = $authorization->skip(fn () => $dbForProject->createDocument('teams', new Document([ '$id' => $teamId, '$permissions' => [ Permission::read(Role::team($teamId)), @@ -491,6 +492,7 @@ App::post('/v1/teams/:teamId/memberships') ->inject('project') ->inject('user') ->inject('dbForProject') + ->inject('authorization') ->inject('locale') ->inject('queueForMails') ->inject('queueForMessaging') @@ -500,9 +502,9 @@ App::post('/v1/teams/:teamId/memberships') ->inject('plan') ->inject('proofForPassword') ->inject('proofForToken') - ->action(function (string $teamId, string $email, string $userId, string $phone, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Mail $queueForMails, Messaging $queueForMessaging, Event $queueForEvents, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, Password $proofForPassword, Token $proofForToken) { - $isAppUser = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + ->action(function (string $teamId, string $email, string $userId, string $phone, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Authorization $authorization, Locale $locale, Mail $queueForMails, Messaging $queueForMessaging, Event $queueForEvents, callable $timelimit, StatsUsage $queueForStatsUsage, array $plan, Password $proofForPassword, Token $proofForToken) { + $isAppUser = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); $url = htmlentities($url); if (empty($url)) { @@ -619,13 +621,13 @@ App::post('/v1/teams/:teamId/memberships') ]); try { - $invitee = Authorization::skip(fn () => $dbForProject->createDocument('users', $userDocument)); + $invitee = $authorization->skip(fn () => $dbForProject->createDocument('users', $userDocument)); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS); } } - $isOwner = Authorization::isRole('team:' . $team->getId() . '/owner'); + $isOwner = $authorization->hasRole('team:' . $team->getId() . '/owner'); if (!$isOwner && !$isPrivilegedUser && !$isAppUser) { // Not owner, not admin, not app (server) throw new Exception(Exception::USER_UNAUTHORIZED, 'User is not allowed to send invitations for this team'); @@ -661,11 +663,11 @@ App::post('/v1/teams/:teamId/memberships') ]); $membership = ($isPrivilegedUser || $isAppUser) ? - Authorization::skip(fn () => $dbForProject->createDocument('memberships', $membership)) : + $authorization->skip(fn () => $dbForProject->createDocument('memberships', $membership)) : $dbForProject->createDocument('memberships', $membership); if ($isPrivilegedUser || $isAppUser) { - Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); + $authorization->skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); } } elseif ($membership->getAttribute('confirm') === false) { $membership->setAttribute('secret', $proofForToken->hash($secret)); @@ -677,7 +679,7 @@ App::post('/v1/teams/:teamId/memberships') } $membership = ($isPrivilegedUser || $isAppUser) ? - Authorization::skip(fn () => $dbForProject->updateDocument('memberships', $membership->getId(), $membership)) : + $authorization->skip(fn () => $dbForProject->updateDocument('memberships', $membership->getId(), $membership)) : $dbForProject->updateDocument('memberships', $membership->getId(), $membership); } else { throw new Exception(Exception::MEMBERSHIP_ALREADY_CONFIRMED); @@ -863,7 +865,8 @@ App::get('/v1/teams/:teamId/memberships') ->inject('response') ->inject('project') ->inject('dbForProject') - ->action(function (string $teamId, array $queries, string $search, bool $includeTotal, Response $response, Document $project, Database $dbForProject) { + ->inject('authorization') + ->action(function (string $teamId, array $queries, string $search, bool $includeTotal, Response $response, Document $project, Database $dbForProject, Authorization $authorization) { $team = $dbForProject->getDocument('teams', $teamId); if ($team->isEmpty()) { @@ -933,7 +936,7 @@ App::get('/v1/teams/:teamId/memberships') 'mfa' => $project->getAttribute('auths', [])['membershipsMfa'] ?? true, ]; - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); $isPrivilegedUser = User::isPrivileged($roles); $isAppUser = User::isApp($roles); @@ -1004,7 +1007,8 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') ->inject('response') ->inject('project') ->inject('dbForProject') - ->action(function (string $teamId, string $membershipId, Response $response, Document $project, Database $dbForProject) { + ->inject('authorization') + ->action(function (string $teamId, string $membershipId, Response $response, Document $project, Database $dbForProject, Authorization $authorization) { $team = $dbForProject->getDocument('teams', $teamId); @@ -1024,7 +1028,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') 'mfa' => $project->getAttribute('auths', [])['membershipsMfa'] ?? true, ]; - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); $isPrivilegedUser = User::isPrivileged($roles); $isAppUser = User::isApp($roles); @@ -1103,8 +1107,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') ->inject('user') ->inject('project') ->inject('dbForProject') + ->inject('authorization') ->inject('queueForEvents') - ->action(function (string $teamId, string $membershipId, array $roles, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $teamId, string $membershipId, array $roles, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Authorization $authorization, Event $queueForEvents) { $team = $dbForProject->getDocument('teams', $teamId); if ($team->isEmpty()) { @@ -1121,9 +1126,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::USER_NOT_FOUND); } - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); - $isAppUser = User::isApp(Authorization::getRoles()); - $isOwner = Authorization::isRole('team:' . $team->getId() . '/owner'); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); + $isAppUser = User::isApp($authorization->getRoles()); + $isOwner = $authorization->hasRole('team:' . $team->getId() . '/owner'); if ($project->getId() === 'console') { // Quick check: fetch up to 2 owners to determine if only one exists @@ -1204,12 +1209,13 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->inject('response') ->inject('user') ->inject('dbForProject') + ->inject('authorization') ->inject('project') ->inject('geodb') ->inject('queueForEvents') ->inject('store') ->inject('proofForToken') - ->action(function (string $teamId, string $membershipId, string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Reader $geodb, Event $queueForEvents, Store $store, Token $proofForToken) { + ->action(function (string $teamId, string $membershipId, string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Authorization $authorization, $project, Reader $geodb, Event $queueForEvents, Store $store, Token $proofForToken) { $protocol = $request->getProtocol(); $membership = $dbForProject->getDocument('memberships', $membershipId); @@ -1218,7 +1224,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') throw new Exception(Exception::MEMBERSHIP_NOT_FOUND); } - $team = Authorization::skip(fn () => $dbForProject->getDocument('teams', $teamId)); + $team = $authorization->skip(fn () => $dbForProject->getDocument('teams', $teamId)); if ($team->isEmpty()) { throw new Exception(Exception::TEAM_NOT_FOUND); @@ -1254,11 +1260,11 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->setAttribute('confirm', true) ; - Authorization::skip(fn () => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); + $authorization->skip(fn () => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); // Create session for the user if not logged in if (!$hasSession) { - Authorization::setRole(Role::user($user->getId())->toString()); + $authorization->addRole(Role::user($user->getId())->toString()); $detector = new Detector($request->getUserAgent('UNKNOWN')); $record = $geodb->get($request->getIP()); @@ -1286,7 +1292,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') $session = $dbForProject->createDocument('sessions', $session); - Authorization::setRole(Role::user($userId)->toString()); + $authorization->addRole(Role::user($userId)->toString()); $encoded = $store ->setProperty('id', $user->getId()) @@ -1324,7 +1330,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') $dbForProject->purgeCachedDocument('users', $user->getId()); - Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); + $authorization->skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); $queueForEvents ->setParam('userId', $user->getId()) @@ -1368,8 +1374,9 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') ->inject('project') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->inject('queueForEvents') - ->action(function (string $teamId, string $membershipId, Document $user, Document $project, Response $response, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $teamId, string $membershipId, Document $user, Document $project, Response $response, Database $dbForProject, Authorization $authorization, Event $queueForEvents) { $membership = $dbForProject->getDocument('memberships', $membershipId); @@ -1427,7 +1434,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') $dbForProject->purgeCachedDocument('users', $profile->getId()); if ($membership->getAttribute('confirm')) { // Count only confirmed members - Authorization::skip(fn () => $dbForProject->decreaseDocumentAttribute('teams', $team->getId(), 'total', 1, 0)); + $authorization->skip(fn () => $dbForProject->decreaseDocumentAttribute('teams', $team->getId(), 'total', 1, 0)); } $queueForEvents diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index bbe1d8a84a..a963284538 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -2678,8 +2678,8 @@ App::get('/v1/users/usage') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->inject('register') - ->action(function (string $range, Response $response, Database $dbForProject) { + ->inject('authorization') + ->action(function (string $range, Response $response, Database $dbForProject, Authorization $authorization) { $periods = Config::getParam('usage', []); $stats = $usage = []; @@ -2689,7 +2689,7 @@ App::get('/v1/users/usage') METRIC_SESSIONS, ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $count => $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 4249dbfd48..2270f4fd89 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -76,7 +76,7 @@ use Utopia\VCS\Exception\RepositoryNotFound; use function Swoole\Coroutine\batch; -$createGitDeployments = function (GitHub $github, string $providerInstallationId, array $repositories, string $providerBranch, string $providerBranchUrl, string $providerRepositoryName, string $providerRepositoryUrl, string $providerRepositoryOwner, string $providerCommitHash, string $providerCommitAuthor, string $providerCommitAuthorUrl, string $providerCommitMessage, string $providerCommitUrl, string $providerPullRequestId, bool $external, Database $dbForPlatform, Build $queueForBuilds, callable $getProjectDB, array $platform) { +$createGitDeployments = function (GitHub $github, string $providerInstallationId, array $repositories, string $providerBranch, string $providerBranchUrl, string $providerRepositoryName, string $providerRepositoryUrl, string $providerRepositoryOwner, string $providerCommitHash, string $providerCommitAuthor, string $providerCommitAuthorUrl, string $providerCommitMessage, string $providerCommitUrl, string $providerPullRequestId, bool $external, Database $dbForPlatform, Authorization $authorization, Build $queueForBuilds, callable $getProjectDB, Request $request, array $platform) { $errors = []; foreach ($repositories as $repository) { try { @@ -87,12 +87,12 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $projectId = $repository->getAttribute('projectId'); - $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); + $project = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); $dbForProject = $getProjectDB($project); $resourceCollection = $resourceType === "function" ? 'functions' : 'sites'; $resourceId = $repository->getAttribute('resourceId'); - $resource = Authorization::skip(fn () => $dbForProject->getDocument($resourceCollection, $resourceId)); + $resource = $authorization->skip(fn () => $dbForProject->getDocument($resourceCollection, $resourceId)); $resourceInternalId = $resource->getSequence(); $deploymentId = ID::unique(); @@ -141,7 +141,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = ''; if (!empty($providerPullRequestId) && $resource->getAttribute('providerSilentMode', false) === false) { - $latestComment = Authorization::skip(fn () => $dbForPlatform->findOne('vcsComments', [ + $latestComment = $authorization->skip(fn () => $dbForPlatform->findOne('vcsComments', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::equal('providerPullRequestId', [$providerPullRequestId]), Query::orderDesc('$createdAt'), @@ -180,7 +180,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); } finally { - Authorization::skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); } } } else { @@ -191,7 +191,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if (!empty($latestCommentId)) { $teamId = $project->getAttribute('teamId', ''); - $latestComment = Authorization::skip(fn () => $dbForPlatform->createDocument('vcsComments', new Document([ + $latestComment = $authorization->skip(fn () => $dbForPlatform->createDocument('vcsComments', new Document([ '$id' => ID::unique(), '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -212,7 +212,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } } elseif (!empty($providerBranch)) { - $latestComments = Authorization::skip(fn () => $dbForPlatform->find('vcsComments', [ + $latestComments = $authorization->skip(fn () => $dbForPlatform->find('vcsComments', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::equal('providerBranch', [$providerBranch]), Query::orderDesc('$createdAt'), @@ -251,7 +251,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = \strval($github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment())); } finally { - Authorization::skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); } } } @@ -294,7 +294,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $commands[] = $resource->getAttribute('commands', ''); } - $deployment = Authorization::skip(fn () => $dbForProject->createDocument('deployments', new Document([ + $deployment = $authorization->skip(fn () => $dbForProject->createDocument('deployments', new Document([ '$id' => $deploymentId, '$permissions' => [ Permission::read(Role::any()), @@ -334,7 +334,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - Authorization::skip(fn () => $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource)); + $authorization->skip(fn () => $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource)); if ($resource->getCollection() === 'sites') { $projectId = $project->getId(); @@ -344,7 +344,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); $previewRuleId = $ruleId; - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -377,7 +377,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -408,7 +408,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $domain = "commit-" . substr($providerCommitHash, 0, 16) . ".{$sitesDomain}"; $ruleId = md5($domain); try { - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -460,7 +460,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if ($lockAcquired) { // Wrap in try/finally to ensure lock file gets deleted try { - $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); + $rule = $authorization->skip(fn () => $dbForPlatform->getDocument('rules', $previewRuleId)); $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $previewUrl = !empty($rule) ? ("{$protocol}://" . $rule->getAttribute('domain', '')) : ''; @@ -472,7 +472,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $github->updateComment($owner, $repositoryName, $latestCommentId, $comment->generateComment()); } } finally { - Authorization::skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('vcsCommentLocks', $latestCommentId)); } } } @@ -1476,11 +1476,12 @@ App::post('/v1/vcs/github/events') ->inject('request') ->inject('response') ->inject('dbForPlatform') + ->inject('authorization') ->inject('getProjectDB') ->inject('queueForBuilds') ->inject('platform') ->action( - function (GitHub $github, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Build $queueForBuilds, array $platform) use ($createGitDeployments) { + function (GitHub $github, Request $request, Response $response, Database $dbForPlatform, Authorization $authorization, callable $getProjectDB, Build $queueForBuilds, array $platform) use ($createGitDeployments) { $payload = $request->getRawPayload(); $signatureRemote = $request->getHeader('x-hub-signature-256', ''); $signatureLocal = System::getEnv('_APP_VCS_GITHUB_WEBHOOK_SECRET', ''); @@ -1516,14 +1517,14 @@ App::post('/v1/vcs/github/events') $github->initializeVariables($providerInstallationId, $privateKey, $githubAppId); //find resourceId from relevant resources table - $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::limit(100), ])); // create new deployment only on push (not committed by us) and not when branch is created or deleted if ($providerCommitAuthorEmail !== APP_VCS_GITHUB_EMAIL && !$providerBranchCreated && !$providerBranchDeleted) { - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthorName, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $queueForBuilds, $getProjectDB, $platform); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthorName, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $authorization, $queueForBuilds, $getProjectDB, $request, $platform); } } elseif ($event == $github::EVENT_INSTALLATION) { if ($parsedPayload["action"] == "deleted") { @@ -1536,16 +1537,16 @@ App::post('/v1/vcs/github/events') ]); foreach ($installations as $installation) { - $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('installationInternalId', [$installation->getSequence()]), Query::limit(1000) ])); foreach ($repositories as $repository) { - Authorization::skip(fn () => $dbForPlatform->deleteDocument('repositories', $repository->getId())); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('repositories', $repository->getId())); } - Authorization::skip(fn () => $dbForPlatform->deleteDocument('installations', $installation->getId())); + $authorization->skip(fn () => $dbForPlatform->deleteDocument('installations', $installation->getId())); } } } elseif ($event == $github::EVENT_PULL_REQUEST) { @@ -1574,12 +1575,12 @@ App::post('/v1/vcs/github/events') $providerCommitAuthor = $commitDetails["commitAuthor"] ?? ''; $providerCommitMessage = $commitDetails["commitMessage"] ?? ''; - $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::orderDesc('$createdAt') ])); - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, $external, $dbForPlatform, $queueForBuilds, $getProjectDB, $platform); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, $external, $dbForPlatform, $authorization, $queueForBuilds, $getProjectDB, $request, $platform); } elseif ($parsedPayload["action"] == "closed") { // Allowed external contributions cleanup @@ -1588,7 +1589,7 @@ App::post('/v1/vcs/github/events') $external = $parsedPayload["external"] ?? true; if ($external) { - $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::orderDesc('$createdAt') ])); @@ -1599,7 +1600,7 @@ App::post('/v1/vcs/github/events') if (\in_array($providerPullRequestId, $providerPullRequestIds)) { $providerPullRequestIds = \array_diff($providerPullRequestIds, [$providerPullRequestId]); $repository = $repository->setAttribute('providerPullRequestIds', $providerPullRequestIds); - $repository = Authorization::skip(fn () => $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository)); + $repository = $authorization->skip(fn () => $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository)); } } } @@ -1786,17 +1787,18 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor ->inject('response') ->inject('project') ->inject('dbForPlatform') + ->inject('authorization') ->inject('getProjectDB') ->inject('queueForBuilds') ->inject('platform') - ->action(function (string $installationId, string $repositoryId, string $providerPullRequestId, GitHub $github, Response $response, Document $project, Database $dbForPlatform, callable $getProjectDB, Build $queueForBuilds, array $platform) use ($createGitDeployments) { + ->action(function (string $installationId, string $repositoryId, string $providerPullRequestId, GitHub $github, Request $request, Response $response, Document $project, Database $dbForPlatform, Authorization $authorization, callable $getProjectDB, Build $queueForBuilds, array $platform) use ($createGitDeployments) { $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); } - $repository = Authorization::skip(fn () => $dbForPlatform->findOne('repositories', [ + $repository = $authorization->skip(fn () => $dbForPlatform->findOne('repositories', [ Query::equal('$id', [$repositoryId]), Query::equal('projectInternalId', [$project->getSequence()]) ])); @@ -1814,7 +1816,7 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor // TODO: Delete from array when PR is closed - $repository = Authorization::skip(fn () => $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository)); + $repository = $authorization->skip(fn () => $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository)); $privateKey = System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'); $githubAppId = System::getEnv('_APP_VCS_GITHUB_APP_ID'); @@ -1846,7 +1848,7 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor $providerCommitMessage = $pullRequestResponse['title'] ?? ''; $providerCommitUrl = $pullRequestResponse['html_url'] ?? ''; - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, true, $dbForPlatform, $queueForBuilds, $getProjectDB, $platform); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, '', '', '', '', $providerCommitHash, '', '', '', '', $providerPullRequestId, true, $dbForPlatform, $authorization, $queueForBuilds, $getProjectDB, $request, $platform); $response->noContent(); }); diff --git a/app/controllers/general.php b/app/controllers/general.php index ec8cfef775..e335f284b7 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -59,7 +59,7 @@ Config::setParam('domainVerification', false); Config::setParam('cookieDomain', 'localhost'); Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE); -function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, ?Key $apiKey) +function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, Authorization $authorization, ?Key $apiKey) { $host = $request->getHostname() ?? ''; if (!empty($previewHostname)) { @@ -67,16 +67,16 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } // TODO: (@Meldiron) Remove after 1.7.x migration - $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; - $rule = Authorization::skip(function () use ($dbForPlatform, $host, $isMd5) { - if ($isMd5) { - return $dbForPlatform->getDocument('rules', md5($host)); - } - - return $dbForPlatform->findOne('rules', [ - Query::equal('domain', [$host]), - ]) ?? new Document(); - }); + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $rule = $authorization->skip(fn () => $dbForPlatform->getDocument('rules', md5($host))); + } else { + $rule = $authorization->skip( + fn () => $dbForPlatform->find('rules', [ + Query::equal('domain', [$host]), + Query::limit(1) + ]) + )[0] ?? new Document(); + } $errorView = __DIR__ . '/../views/general/error.phtml'; $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; @@ -111,7 +111,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $projectId = $rule->getAttribute('projectId'); - $project = Authorization::skip( + $project = $authorization->skip( fn () => $dbForPlatform->getDocument('projects', $projectId) ); @@ -119,7 +119,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $accessedAt = $project->getAttribute('accessedAt', 0); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $accessedAt) { $project->setAttribute('accessedAt', DateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); } /** @@ -158,7 +158,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw /** @var Document $deployment */ if (!empty($rule->getAttribute('deploymentId', ''))) { - $deployment = Authorization::skip(fn () => $dbForProject->getDocument('deployments', $rule->getAttribute('deploymentId'))); + $deployment = $authorization->skip(fn () => $dbForProject->getDocument('deployments', $rule->getAttribute('deploymentId'))); } else { // 1.6.x DB schema compatibility // TODO: Make sure deploymentId is never empty, and remove this code @@ -172,15 +172,15 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw // Document of site or function $resource = $resourceType === 'function' ? - Authorization::skip(fn () => $dbForProject->getDocument('functions', $resourceId)) : - Authorization::skip(fn () => $dbForProject->getDocument('sites', $resourceId)); + $authorization->skip(fn () => $dbForProject->getDocument('functions', $resourceId)) : + $authorization->skip(fn () => $dbForProject->getDocument('sites', $resourceId)); // ID of active deployments // Attempts to use attribute from both schemas (1.6 and 1.7) $activeDeploymentId = $resource->getAttribute('deploymentId', $resource->getAttribute('deployment', '')); // Get deployment document, as intended originally - $deployment = Authorization::skip(fn () => $dbForProject->getDocument('deployments', $activeDeploymentId)); + $deployment = $authorization->skip(fn () => $dbForProject->getDocument('deployments', $activeDeploymentId)); } if ($deployment->getAttribute('resourceType', '') === 'functions') { @@ -199,8 +199,8 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $resource = $type === 'function' ? - Authorization::skip(fn () => $dbForProject->getDocument('functions', $deployment->getAttribute('resourceId', ''))) : - Authorization::skip(fn () => $dbForProject->getDocument('sites', $deployment->getAttribute('resourceId', ''))); + $authorization->skip(fn () => $dbForProject->getDocument('functions', $deployment->getAttribute('resourceId', ''))) : + $authorization->skip(fn () => $dbForProject->getDocument('sites', $deployment->getAttribute('resourceId', ''))); $isPreview = $type === 'function' ? false : ($rule->getAttribute('trigger', '') !== 'manual'); @@ -242,7 +242,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $userExists = false; $userId = $payload['userId'] ?? ''; if (!empty($userId)) { - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); if (!$user->isEmpty() && $user->getAttribute('status', false)) { $userExists = true; } @@ -255,7 +255,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $membershipExists = false; - $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); + $project = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); if (!$project->isEmpty() && isset($user)) { $teamId = $project->getAttribute('teamId', ''); $membership = $user->find('teamId', $teamId, 'memberships'); @@ -862,15 +862,16 @@ App::init() ->inject('devKey') ->inject('apiKey') ->inject('cors') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Func $queueForFunctions, Executor $executor, array $platform, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey, Cors $cors) { + ->inject('authorization') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Func $queueForFunctions, Executor $executor, array $platform, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey, Cors $cors, Authorization $authorization) { /* * Appwrite Router */ $hostname = $request->getHostname() ?? ''; $platformHostnames = $platform['hostnames'] ?? []; // Only run Router when external domain - if (!in_array($hostname, $platformHostnames) || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $apiKey)) { + if (!\in_array($hostname, $platformHostnames) || !empty($previewHostname)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $authorization, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1033,7 +1034,8 @@ App::init() ->inject('dbForPlatform') ->inject('queueForCertificates') ->inject('platform') - ->action(function (Request $request, Document $console, Database $dbForPlatform, Certificate $queueForCertificates, array $platform) { + ->inject('authorization') + ->action(function (Request $request, Document $console, Database $dbForPlatform, Certificate $queueForCertificates, array $platform, Authorization $authorization) { $hostname = $request->getHostname(); $cache = Config::getParam('hostnames', []); $platformHostnames = $platform['hostnames'] ?? []; @@ -1061,64 +1063,64 @@ App::init() } // 4. Check/create rule (requires DB access) - Authorization::disable(); - try { - // TODO: (@Meldiron) Remove after 1.7.x migration - $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; - $document = $isMd5 - ? $dbForPlatform->getDocument('rules', md5($domain->get())) - : $dbForPlatform->findOne('rules', [ - Query::equal('domain', [$domain->get()]), + $authorization->skip(function () use ($dbForPlatform, $domain, $console, $queueForCertificates, &$cache) { + try { + // TODO: (@Meldiron) Remove after 1.7.x migration + $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; + $document = $isMd5 + ? $dbForPlatform->getDocument('rules', md5($domain->get())) + : $dbForPlatform->findOne('rules', [ + Query::equal('domain', [$domain->get()]), + ]); + + if (!$document->isEmpty()) { + return; + } + + // 5. Create new rule + $owner = ''; + $fallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''); + $funcDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); + $siteDomain = System::getEnv('_APP_DOMAIN_SITES', ''); + + if (!empty($fallback) && \str_ends_with($domain->get(), $fallback)) { + $funcDomain = $fallback; + } + + if ( + (!empty($funcDomain) && \str_ends_with($domain->get(), $funcDomain)) || + (!empty($siteDomain) && \str_ends_with($domain->get(), $siteDomain)) + ) { + $owner = 'Appwrite'; + } + + $ruleId = $isMd5 ? md5($domain->get()) : ID::unique(); + $document = new Document([ + '$id' => $ruleId, + 'domain' => $domain->get(), + 'type' => 'api', + 'status' => 'verifying', + 'projectId' => $console->getId(), + 'projectInternalId' => $console->getSequence(), + 'search' => implode(' ', [$ruleId, $domain->get()]), + 'owner' => $owner, + 'region' => $console->getAttribute('region') ]); - if (!$document->isEmpty()) { - return; + $dbForPlatform->createDocument('rules', $document); + + Console::info('Issuing a TLS certificate for the main domain (' . $domain->get() . ') in a few seconds...'); + $queueForCertificates + ->setDomain($document) + ->setSkipRenewCheck(true) + ->trigger(); + } catch (Duplicate $e) { + Console::info('Certificate already exists'); + } finally { + $cache[$domain->get()] = true; + Config::setParam('hostnames', $cache); } - - // 5. Create new rule - $owner = ''; - $fallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''); - $funcDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); - $siteDomain = System::getEnv('_APP_DOMAIN_SITES', ''); - - if (!empty($fallback) && \str_ends_with($domain->get(), $fallback)) { - $funcDomain = $fallback; - } - - if ( - (!empty($funcDomain) && \str_ends_with($domain->get(), $funcDomain)) || - (!empty($siteDomain) && \str_ends_with($domain->get(), $siteDomain)) - ) { - $owner = 'Appwrite'; - } - - $ruleId = $isMd5 ? md5($domain->get()) : ID::unique(); - $document = new Document([ - '$id' => $ruleId, - 'domain' => $domain->get(), - 'type' => 'api', - 'status' => 'verifying', - 'projectId' => $console->getId(), - 'projectInternalId' => $console->getSequence(), - 'search' => implode(' ', [$ruleId, $domain->get()]), - 'owner' => $owner, - 'region' => $console->getAttribute('region') - ]); - - $dbForPlatform->createDocument('rules', $document); - - Console::info('Issuing a TLS certificate for the main domain (' . $domain->get() . ') in a few seconds...'); - $queueForCertificates - ->setDomain($document) - ->setSkipRenewCheck(true) - ->trigger(); - } catch (Duplicate $e) { - Console::info('Certificate already exists'); - } finally { - $cache[$domain->get()] = true; - Config::setParam('hostnames', $cache); - Authorization::reset(); - } + }); }); App::options() @@ -1141,14 +1143,15 @@ App::options() ->inject('devKey') ->inject('apiKey') ->inject('cors') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey, Cors $cors) { + ->inject('authorization') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey, Cors $cors, Authorization $authorization) { /* * Appwrite Router */ $platformHostnames = $platform['hostnames'] ?? []; // Only run Router when external domain if (!in_array($request->getHostname(), $platformHostnames) || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $authorization, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1182,7 +1185,8 @@ App::error() ->inject('log') ->inject('queueForStatsUsage') ->inject('devKey') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, StatsUsage $queueForStatsUsage) { + ->inject('authorization') + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, StatsUsage $queueForStatsUsage, Document $devKey, Authorization $authorization) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); @@ -1264,7 +1268,7 @@ App::error() * If not a publishable error, track usage stats. Publishable errors are >= 500 or those explicitly marked as publish=true in errors.php */ if (!$publish && $project->getId() !== 'console') { - if (!DBUser::isPrivileged(Authorization::getRoles())) { + if (!DBUser::isPrivileged($authorization->getRoles())) { $fileSize = 0; $file = $request->getFiles('file'); if (!empty($file)) { @@ -1326,7 +1330,7 @@ App::error() $log->addExtra('file', $error->getFile()); $log->addExtra('line', $error->getLine()); $log->addExtra('trace', $error->getTraceAsString()); - $log->addExtra('roles', Authorization::getRoles()); + $log->addExtra('roles', $authorization->getRoles()); try { /* add queries to log */ @@ -1530,13 +1534,14 @@ App::get('/robots.txt') ->inject('platform') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, ?Key $apiKey) { + ->inject('authorization') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, ?Key $apiKey, Authorization $authorization) { $platformHostnames = $platform['hostnames'] ?? []; if (in_array($request->getHostname(), $platformHostnames) || !empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/robots.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $authorization, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1562,13 +1567,14 @@ App::get('/humans.txt') ->inject('platform') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, ?Key $apiKey) { + ->inject('authorization') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, array $platform, string $previewHostname, ?Key $apiKey, Authorization $authorization) { $platformHostnames = $platform['hostnames'] ?? []; if (in_array($request->getHostname(), $platformHostnames) || !empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/humans.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $platform, $previewHostname, $authorization, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1652,7 +1658,8 @@ App::get('/v1/ping') ->inject('project') ->inject('dbForPlatform') ->inject('queueForEvents') - ->action(function (Response $response, Document $project, Database $dbForPlatform, Event $queueForEvents) { + ->inject('authorization') + ->action(function (Response $response, Document $project, Database $dbForPlatform, Event $queueForEvents, Authorization $authorization) { if ($project->isEmpty() || $project->getId() === 'console') { throw new AppwriteException(AppwriteException::PROJECT_NOT_FOUND); } @@ -1664,7 +1671,7 @@ App::get('/v1/ping') ->setAttribute('pingCount', $pingCount) ->setAttribute('pingedAt', $pingedAt); - Authorization::skip(function () use ($dbForPlatform, $project) { + $authorization->skip(function () use ($dbForPlatform, $project) { $dbForPlatform->updateDocument('projects', $project->getId(), $project); }); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 05c08a2231..23bbb12183 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -30,6 +30,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Queue\Publisher; use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; @@ -233,7 +234,8 @@ App::init() ->inject('mode') ->inject('team') ->inject('apiKey') - ->action(function (App $utopia, Request $request, Database $dbForPlatform, Database $dbForProject, Audit $queueForAudits, Document $project, User $user, ?Document $session, array $servers, string $mode, Document $team, ?Key $apiKey) { + ->inject('authorization') + ->action(function (App $utopia, Request $request, Database $dbForPlatform, Database $dbForProject, Audit $queueForAudits, Document $project, Document $user, ?Document $session, array $servers, string $mode, Document $team, ?Key $apiKey, Authorization $authorization) { $route = $utopia->getRoute(); /** @@ -318,7 +320,7 @@ App::init() // Handle special app role case if ($apiKey->getRole() === User::ROLE_APPS) { // Disable authorization checks for API keys - Authorization::setDefaultStatus(false); + $authorization->setDefaultStatus(false); $user = new User([ '$id' => '', @@ -392,14 +394,14 @@ App::init() $scopes = \array_merge($scopes, $roles[$role]['scopes']); } - Authorization::setDefaultStatus(false); // Cancel security segmentation for admin users. + $authorization->setDefaultStatus(false); // Cancel security segmentation for admin users. } $scopes = \array_unique($scopes); - Authorization::setRole($role); - foreach ($user->getRoles() as $authRole) { - Authorization::setRole($authRole); + $authorization->addRole($role); + foreach ($user->getRoles($authorization) as $authRole) { + $authorization->addRole($authRole); } // Step 6: Update project and user last activity @@ -407,7 +409,7 @@ App::init() $accessedAt = $project->getAttribute('accessedAt', 0); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $accessedAt) { $project->setAttribute('accessedAt', DateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); } } @@ -442,7 +444,7 @@ App::init() if ( array_key_exists($namespace, $project->getAttribute('services', [])) && !$project->getAttribute('services', [])[$namespace] - && !(User::isPrivileged(Authorization::getRoles()) || User::isApp(Authorization::getRoles())) + && !(User::isPrivileged($authorization->getRoles()) || User::isApp($authorization->getRoles())) ) { throw new Exception(Exception::GENERAL_SERVICE_DISABLED); } @@ -509,14 +511,15 @@ App::init() ->inject('devKey') ->inject('telemetry') ->inject('platform') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Mail $queueForMails, Migration $queueForMigrations, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry, array $platform) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('authorization') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Publisher $publisherFunctions, Publisher $publisherWebhooks, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Mail $queueForMails, Migration $queueForMigrations, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode, ?Key $apiKey, array $plan, Document $devKey, Telemetry $telemetry, array $platform, Authorization $authorization) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); if ( array_key_exists('rest', $project->getAttribute('apis', [])) && !$project->getAttribute('apis', [])['rest'] - && !(User::isPrivileged(Authorization::getRoles()) || User::isApp(Authorization::getRoles())) + && !(User::isPrivileged($authorization->getRoles()) || User::isApp($authorization->getRoles())) ) { throw new AppwriteException(AppwriteException::GENERAL_API_DISABLED); } @@ -546,7 +549,7 @@ App::init() $closestLimit = null; - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); $isPrivilegedUser = User::isPrivileged($roles); $isAppUser = User::isApp($roles); @@ -657,10 +660,10 @@ App::init() if ($useCache) { $route = $utopia->match($request); $isImageTransformation = $route->getPath() === '/v1/storage/buckets/:bucketId/files/:fileId/preview'; - $isDisabled = isset($plan['imageTransformations']) && $plan['imageTransformations'] === -1 && !User::isPrivileged(Authorization::getRoles()); + $isDisabled = isset($plan['imageTransformations']) && $plan['imageTransformations'] === -1 && !User::isPrivileged($authorization->getRoles()); $key = $request->cacheIdentifier(); - $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); + $cacheLog = $authorization->skip(fn () => $dbForProject->getDocument('cache', $key)); $cache = new Cache( new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) ); @@ -677,10 +680,10 @@ App::init() if ($type === 'bucket' && (!$isImageTransformation || !$isDisabled)) { $bucketId = $parts[1] ?? null; - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAppUser && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -691,8 +694,7 @@ App::init() } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid && !$isToken) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -703,7 +705,7 @@ App::init() if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { @@ -714,11 +716,11 @@ App::init() throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } //Do not update transformedAt if it's a console user - if (!User::isPrivileged(Authorization::getRoles())) { + if (!User::isPrivileged($authorization->getRoles())) { $transformedAt = $file->getAttribute('transformedAt', ''); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) { $file->setAttribute('transformedAt', DateTime::now()); - Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file)); + $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file)); } } } @@ -814,8 +816,9 @@ App::shutdown() ->inject('queueForWebhooks') ->inject('queueForRealtime') ->inject('dbForProject') + ->inject('authorization') ->inject('timelimit') - ->action(function (App $utopia, Request $request, Response $response, Document $project, User $user, Event $queueForEvents, Audit $queueForAudits, StatsUsage $queueForStatsUsage, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Messaging $queueForMessaging, Func $queueForFunctions, Event $queueForWebhooks, Realtime $queueForRealtime, Database $dbForProject, callable $timelimit) use ($parseLabel) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, User $user, Event $queueForEvents, Audit $queueForAudits, StatsUsage $queueForStatsUsage, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Messaging $queueForMessaging, Func $queueForFunctions, Event $queueForWebhooks, Realtime $queueForRealtime, Database $dbForProject, Authorization $authorization, callable $timelimit) use ($parseLabel) { $responsePayload = $response->getPayload(); @@ -976,11 +979,11 @@ App::shutdown() $key = $request->cacheIdentifier(); $signature = md5($data['payload']); - $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); + $cacheLog = $authorization->skip(fn () => $dbForProject->getDocument('cache', $key)); $accessedAt = $cacheLog->getAttribute('accessedAt', 0); $now = DateTime::now(); if ($cacheLog->isEmpty()) { - Authorization::skip(fn () => $dbForProject->createDocument('cache', new Document([ + $authorization->skip(fn () => $dbForProject->createDocument('cache', new Document([ '$id' => $key, 'resource' => $resource, 'resourceType' => $resourceType, @@ -990,7 +993,7 @@ App::shutdown() ]))); } elseif (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_CACHE_UPDATE)) > $accessedAt) { $cacheLog->setAttribute('accessedAt', $now); - Authorization::skip(fn () => $dbForProject->updateDocument('cache', $cacheLog->getId(), $cacheLog)); + $authorization->skip(fn () => $dbForProject->updateDocument('cache', $cacheLog->getId(), $cacheLog)); // Overwrite the file every APP_CACHE_UPDATE seconds to update the file modified time that is used in the TTL checks in cache->load() $cache->save($key, $data['payload']); } @@ -1002,7 +1005,7 @@ App::shutdown() } if ($project->getId() !== 'console') { - if (!User::isPrivileged(Authorization::getRoles())) { + if (!User::isPrivileged($authorization->getRoles())) { $fileSize = 0; $file = $request->getFiles('file'); if (!empty($file)) { diff --git a/app/controllers/shared/api/auth.php b/app/controllers/shared/api/auth.php index efa733fc34..c0f7494125 100644 --- a/app/controllers/shared/api/auth.php +++ b/app/controllers/shared/api/auth.php @@ -36,7 +36,8 @@ App::init() ->inject('request') ->inject('project') ->inject('geodb') - ->action(function (App $utopia, Request $request, Document $project, Reader $geodb) { + ->inject('authorization') + ->action(function (App $utopia, Request $request, Document $project, Reader $geodb, Authorization $authorization) { $denylist = System::getEnv('_APP_CONSOLE_COUNTRIES_DENYLIST', ''); if (!empty($denylist && $project->getId() === 'console')) { $countries = explode(',', $denylist); @@ -49,8 +50,8 @@ App::init() $route = $utopia->match($request); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); - $isAppUser = User::isApp(Authorization::getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); + $isAppUser = User::isApp($authorization->getRoles()); if ($isAppUser || $isPrivilegedUser) { // Skip limits for app and console devs return; diff --git a/app/http.php b/app/http.php index b7f857da48..5d08c53eee 100644 --- a/app/http.php +++ b/app/http.php @@ -27,7 +27,6 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\Logger\Log; use Utopia\Logger\Log\User; use Utopia\Pools\Group; @@ -261,7 +260,9 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg createDatabase($app, 'getLogsDB', 'logs', $collections['logs'], $pools); // create appwrite database, `dbForPlatform` is a direct access call. - createDatabase($app, 'dbForPlatform', 'appwrite', $collections['console'], $pools, function (Database $dbForPlatform) use ($collections) { + createDatabase($app, 'dbForPlatform', 'appwrite', $collections['console'], $pools, function (Database $dbForPlatform) use ($collections, $app) { + $authorization = $app->getResource('authorization'); + if ($dbForPlatform->getCollection(AuditAdapterSQL::COLLECTION)->isEmpty()) { $adapter = new AdapterDatabase($dbForPlatform); $audit = new Audit($adapter); @@ -321,9 +322,9 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg $dbForPlatform->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes); } - if (Authorization::skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')->isEmpty())) { + if ($authorization->skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')->isEmpty())) { Console::info(" └── Creating screenshots bucket..."); - Authorization::skip(fn () => $dbForPlatform->createDocument('buckets', new Document([ + $authorization->skip(fn () => $dbForPlatform->createDocument('buckets', new Document([ '$id' => ID::custom('screenshots'), '$collection' => ID::custom('buckets'), 'name' => 'Screenshots', @@ -338,7 +339,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg 'search' => 'buckets Screenshots', ]))); - $bucket = Authorization::skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')); + $bucket = $authorization->skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')); Console::info(" └── Creating files collection for screenshots bucket..."); $files = $collections['buckets']['files'] ?? []; @@ -366,7 +367,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg 'orders' => $index['orders'], ]), $files['indexes']); - Authorization::skip(fn () => $dbForPlatform->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes)); + $authorization->skip(fn () => $dbForPlatform->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes)); } }); @@ -458,8 +459,12 @@ $http->on(Constant::EVENT_REQUEST, function (SwooleRequest $swooleRequest, Swool App::setResource('pools', fn () => $pools); try { - Authorization::cleanRoles(); - Authorization::setRole(Role::any()->toString()); + $authorization = $app->getResource('authorization'); + + $request->setAuthorization($authorization); + $response->setAuthorization($authorization); + $authorization->cleanRoles(); + $authorization->addRole(Role::any()->toString()); $app->run($request, $response); } catch (\Throwable $th) { @@ -501,7 +506,7 @@ $http->on(Constant::EVENT_REQUEST, function (SwooleRequest $swooleRequest, Swool $log->addExtra('file', $th->getFile()); $log->addExtra('line', $th->getLine()); $log->addExtra('trace', $th->getTraceAsString()); - $log->addExtra('roles', Authorization::getRoles()); + $log->addExtra('roles', isset($authorization) ? $authorization->getRoles() : []); $sdk = $route->getLabel("sdk", false); @@ -560,7 +565,7 @@ $http->on(Constant::EVENT_TASK, function () use ($register, $domains) { /** @var Utopia\Database\Database $dbForPlatform */ $dbForPlatform = $app->getResource('dbForPlatform'); - Timer::tick(DOMAIN_SYNC_TIMER * 1000, function () use ($dbForPlatform, $domains, &$lastSyncUpdate) { + Timer::tick(DOMAIN_SYNC_TIMER * 1000, function () use ($dbForPlatform, $domains, &$lastSyncUpdate, $app) { try { $time = DateTime::now(); $limit = 1000; @@ -577,7 +582,8 @@ $http->on(Constant::EVENT_TASK, function () use ($register, $domains) { } $results = []; try { - $results = Authorization::skip(fn () => $dbForPlatform->find('rules', $queries)); + $authorization = $app->getResource('authorization'); + $results = $authorization->skip(fn () => $dbForPlatform->find('rules', $queries)); } catch (Throwable $th) { Console::error($th->getMessage()); } diff --git a/app/init/constants.php b/app/init/constants.php index 0c95c4543b..d51cb6b7af 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -161,6 +161,9 @@ const ACTIVITY_TYPE_GUEST = 'guest'; const MFA_RECENT_DURATION = 1800; // 30 mins +// Database name +const APP_DATABASE = 'appwrite'; + // Database Reconnect const DATABASE_RECONNECT_SLEEP = 2; const DATABASE_RECONNECT_MAX_ATTEMPTS = 10; diff --git a/app/init/database/filters.php b/app/init/database/filters.php index c9ad3fce03..2b2e17b6a9 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -4,7 +4,6 @@ use Appwrite\OpenSSL\OpenSSL; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\System\System; Database::addFilter( @@ -70,11 +69,11 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - $attributes = $database->find('attributes', [ + $attributes = $database->getAuthorization()->skip(fn () => $database->find('attributes', [ Query::equal('collectionInternalId', [$document->getSequence()]), Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]), Query::limit($database->getLimitForAttributes()), - ]); + ])); foreach ($attributes as $attribute) { $attributeType = $attribute->getAttribute('type'); @@ -105,12 +104,12 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('indexes', [ Query::equal('collectionInternalId', [$document->getSequence()]), Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]), Query::limit($database->getLimitForIndexes()), - ]); + ])); } ); @@ -120,11 +119,11 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('platforms', [ Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), - ]); + ])); } ); @@ -134,12 +133,12 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('keys', [ Query::equal('resourceType', ['projects']), Query::equal('resourceInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), - ]); + ])); } ); @@ -149,11 +148,11 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('devKeys', [ Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), - ]); + ])); } ); @@ -163,11 +162,11 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('webhooks', [ Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), - ]); + ])); } ); @@ -177,7 +176,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database->find('sessions', [ + return $database->getAuthorization()->skip(fn () => $database->find('sessions', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); @@ -190,7 +189,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database + return $database->getAuthorization()->skip(fn () => $database ->find('tokens', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), @@ -204,7 +203,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database + return $database->getAuthorization()->skip(fn () => $database ->find('challenges', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), @@ -218,7 +217,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database + return $database->getAuthorization()->skip(fn () => $database ->find('authenticators', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), @@ -232,7 +231,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database + return $database->getAuthorization()->skip(fn () => $database ->find('memberships', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), @@ -252,14 +251,14 @@ Database::addFilter( default => ['function', 'site'] }; - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('variables', [ Query::equal('resourceInternalId', [$document->getSequence()]), Query::equal('resourceType', $resourceType), Query::orderAsc('resourceType'), Query::orderAsc(), Query::limit(APP_LIMIT_SUBQUERY), - ]); + ])); } ); @@ -295,11 +294,11 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return $database + return $database->getAuthorization()->skip(fn () => $database ->find('variables', [ Query::equal('resourceType', ['project']), Query::limit(APP_LIMIT_SUBQUERY) - ]); + ])); } ); @@ -332,7 +331,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - return Authorization::skip(fn () => $database + return $database->getAuthorization()->skip(fn () => $database ->find('targets', [ Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY) @@ -346,7 +345,7 @@ Database::addFilter( return; }, function (mixed $value, Document $document, Database $database) { - $targetIds = Authorization::skip(fn () => \array_map( + $targetIds = $database->getAuthorization()->skip(fn () => \array_map( fn ($document) => $document->getAttribute('targetInternalId'), $database->find('subscribers', [ Query::equal('topicInternalId', [$document->getSequence()]), diff --git a/app/init/registers.php b/app/init/registers.php index 1b58c85aa4..9799c56914 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -324,6 +324,12 @@ $register->set('pools', function () { Config::setParam('pools-' . $key, $config); } + $reconnectAttempts = (int) System::getEnv('_APP_CONNECTIONS_RECONNECT_ATTEMPTS', 5); + $reconnectSleep = (int) System::getEnv('_APP_CONNECTIONS_RECONNECT_SLEEP', 2); + + $group->setReconnectAttempts($reconnectAttempts); + $group->setReconnectSleep($reconnectSleep); + return $group; }); diff --git a/app/init/resources.php b/app/init/resources.php index a3aa3ae47c..a9d46a17be 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -230,7 +230,7 @@ App::setResource('allowedSchemes', function (Document $project) { /** * Rule associated with a request origin. */ -App::setResource('rule', function (Request $request, Database $dbForPlatform, Document $project) { +App::setResource('rule', function (Request $request, Database $dbForPlatform, Document $project, Authorization $authorization) { $domain = \parse_url($request->getOrigin(), PHP_URL_HOST); if (empty($domain)) { return new Document(); @@ -238,7 +238,7 @@ App::setResource('rule', function (Request $request, Database $dbForPlatform, Do // TODO: (@Meldiron) Remove after 1.7.x migration $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; - $rule = Authorization::skip(function () use ($dbForPlatform, $domain, $isMd5) { + $rule = $authorization->skip(function () use ($dbForPlatform, $domain, $isMd5) { if ($isMd5) { return $dbForPlatform->getDocument('rules', md5($domain)); } @@ -253,7 +253,7 @@ App::setResource('rule', function (Request $request, Database $dbForPlatform, Do } return $rule; -}, ['request', 'dbForPlatform', 'project']); +}, ['request', 'dbForPlatform', 'project', 'authorization']); /** * CORS service @@ -321,7 +321,7 @@ App::setResource('redirectValidator', function (Document $devKey, array $allowed return new Redirect($allowedHostnames, $allowedSchemes); }, ['devKey', 'allowedHostnames', 'allowedSchemes']); -App::setResource('user', function (string $mode, Document $project, Document $console, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Store $store, Token $proofForToken) { +App::setResource('user', function (string $mode, Document $project, Document $console, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Store $store, Token $proofForToken, $authorization) { /** * Handles user authentication and session validation. * @@ -341,7 +341,7 @@ App::setResource('user', function (string $mode, Document $project, Document $co * overwriting the previous value. */ - Authorization::setDefaultStatus(true); + $authorization->setDefaultStatus(true); $store->setKey('a_session_' . $project->getId()); @@ -408,7 +408,7 @@ App::setResource('user', function (string $mode, Document $project, Document $co } // if (APP_MODE_ADMIN === $mode) { // if ($user->find('teamInternalId', $project->getAttribute('teamInternalId'), 'memberships')) { - // Authorization::setDefaultStatus(false); // Cancel security segmentation for admin users. + // $authorization->setDefaultStatus(false); // Cancel security segmentation for admin users. // } else { // $user = new Document([]); // } @@ -440,9 +440,9 @@ App::setResource('user', function (string $mode, Document $project, Document $co $dbForPlatform->setMetadata('user', $user->getId()); return $user; -}, ['mode', 'project', 'console', 'request', 'response', 'dbForProject', 'dbForPlatform', 'store', 'proofForToken']); +}, ['mode', 'project', 'console', 'request', 'response', 'dbForProject', 'dbForPlatform', 'store', 'proofForToken', 'authorization']); -App::setResource('project', function ($dbForPlatform, $request, $console) { +App::setResource('project', function ($dbForPlatform, $request, $console, $authorization) { /** @var Appwrite\Utopia\Request $request */ /** @var Utopia\Database\Database $dbForPlatform */ /** @var Utopia\Database\Document $console */ @@ -453,10 +453,10 @@ App::setResource('project', function ($dbForPlatform, $request, $console) { return $console; } - $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); + $project = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); return $project; -}, ['dbForPlatform', 'request', 'console']); +}, ['dbForPlatform', 'request', 'console', 'authorization']); App::setResource('session', function (User $user, Store $store, Token $proofForToken) { if ($user->isEmpty()) { @@ -479,10 +479,6 @@ App::setResource('session', function (User $user, Store $store, Token $proofForT return; }, ['user', 'store', 'proofForToken']); -App::setResource('console', function () { - return new Document(Config::getParam('console')); -}, []); - App::setResource('store', function (): Store { return new Store(); }); @@ -513,7 +509,15 @@ App::setResource('proofForCode', function (): Code { return $code; }); -App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform, Cache $cache, Document $project) { +App::setResource('console', function () { + return new Document(Config::getParam('console')); +}, []); + +App::setResource('authorization', function () { + return new Authorization(); +}, []); + +App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform, Cache $cache, Document $project, Authorization $authorization) { if ($project->isEmpty() || $project->getId() === 'console') { return $dbForPlatform; } @@ -529,6 +533,8 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform $database = new Database($adapter, $cache); $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setMetadata('host', \gethostname()) ->setMetadata('project', $project->getId()) ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API) @@ -550,13 +556,16 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform } return $database; -}, ['pools', 'dbForPlatform', 'cache', 'project']); +}, ['pools', 'dbForPlatform', 'cache', 'project', 'authorization']); + +App::setResource('dbForPlatform', function (Group $pools, Cache $cache, Authorization $authorization) { -App::setResource('dbForPlatform', function (Group $pools, Cache $cache) { $adapter = new DatabasePool($pools->get('console')); $database = new Database($adapter, $cache); $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setNamespace('_console') ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console') @@ -566,12 +575,12 @@ App::setResource('dbForPlatform', function (Group $pools, Cache $cache) { $database->setDocumentType('users', User::class); return $database; -}, ['pools', 'cache']); +}, ['pools', 'cache', 'authorization']); -App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { +App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, Authorization $authorization) { $databases = []; - return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) { + return function (Document $project) use ($pools, $dbForPlatform, $cache, $authorization, &$databases) { if ($project->isEmpty() || $project->getId() === 'console') { return $dbForPlatform; } @@ -583,13 +592,16 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform $dsn = new DSN('mysql://' . $project->getAttribute('database')); } - $configure = (function (Database $database) use ($project, $dsn) { + $configure = (function (Database $database) use ($project, $dsn, $authorization) { $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setMetadata('host', \gethostname()) ->setMetadata('project', $project->getId()) ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API) - ->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES); - $database->setDocumentType('users', User::class); + ->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES) + ->setDocumentType('users', User::class) + ; $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); @@ -619,12 +631,12 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform return $database; }; -}, ['pools', 'dbForPlatform', 'cache']); +}, ['pools', 'dbForPlatform', 'cache', 'authorization']); -App::setResource('getLogsDB', function (Group $pools, Cache $cache) { +App::setResource('getLogsDB', function (Group $pools, Cache $cache, Authorization $authorization) { $database = null; - return function (?Document $project = null) use ($pools, $cache, &$database) { + return function (?Document $project = null) use ($pools, $cache, $authorization, &$database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { $database->setTenant((int) $project->getSequence()); return $database; @@ -634,6 +646,8 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = new Database($adapter, $cache); $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setSharedTables(true) ->setNamespace('logsV1') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_API) @@ -646,7 +660,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { return $database; }; -}, ['pools', 'cache']); +}, ['pools', 'cache', 'authorization']); App::setResource('audit', function ($dbForProject) { $adapter = new AdapterDatabase($dbForProject); @@ -845,7 +859,7 @@ App::setResource('promiseAdapter', function ($register) { return $register->get('promiseAdapter'); }, ['register']); -App::setResource('schema', function ($utopia, $dbForProject) { +App::setResource('schema', function ($utopia, $dbForProject, $authorization) { $complexity = function (int $complexity, array $args) { $queries = Query::parseQueries($args['queries'] ?? []); @@ -855,8 +869,8 @@ App::setResource('schema', function ($utopia, $dbForProject) { return $complexity * $limit; }; - $attributes = function (int $limit, int $offset) use ($dbForProject) { - $attrs = Authorization::skip(fn () => $dbForProject->find('attributes', [ + $attributes = function (int $limit, int $offset) use ($dbForProject, $authorization) { + $attrs = $authorization->skip(fn () => $dbForProject->find('attributes', [ Query::limit($limit), Query::offset($offset), ])); @@ -930,7 +944,7 @@ App::setResource('schema', function ($utopia, $dbForProject) { $urls, $params, ); -}, ['utopia', 'dbForProject']); +}, ['utopia', 'dbForProject', 'authorization']); App::setResource('gitHub', function (Cache $cache) { return new VcsGitHub($cache); @@ -958,7 +972,7 @@ App::setResource('smsRates', function () { return []; }); -App::setResource('devKey', function (Request $request, Document $project, array $servers, Database $dbForPlatform) { +App::setResource('devKey', function (Request $request, Document $project, array $servers, Database $dbForPlatform, Authorization $authorization) { $devKey = $request->getHeader('x-appwrite-dev-key', $request->getParam('devKey', '')); // Check if given key match project's development keys @@ -977,7 +991,7 @@ App::setResource('devKey', function (Request $request, Document $project, array $accessedAt = $key->getAttribute('accessedAt', 0); if (empty($accessedAt) || DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { $key->setAttribute('accessedAt', DatabaseDateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } @@ -994,15 +1008,15 @@ App::setResource('devKey', function (Request $request, Document $project, array /** Update access time as well */ $key->setAttribute('accessedAt', DatabaseDateTime::now()); - $key = Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); + $key = $authorization->skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } } return $key; -}, ['request', 'project', 'servers', 'dbForPlatform']); +}, ['request', 'project', 'servers', 'dbForPlatform', 'authorization']); -App::setResource('team', function (Document $project, Database $dbForPlatform, App $utopia, Request $request) { +App::setResource('team', function (Document $project, Database $dbForPlatform, App $utopia, Request $request, Authorization $authorization) { $teamInternalId = ''; if ($project->getId() !== 'console') { $teamInternalId = $project->getAttribute('teamInternalId', ''); @@ -1012,7 +1026,7 @@ App::setResource('team', function (Document $project, Database $dbForPlatform, A if (str_starts_with($path, '/v1/projects/:projectId')) { $uri = $request->getURI(); $pid = explode('/', $uri)[3]; - $p = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $pid)); + $p = $authorization->skip(fn () => $dbForPlatform->getDocument('projects', $pid)); $teamInternalId = $p->getAttribute('teamInternalId', ''); } elseif ($path === '/v1/projects') { $teamId = $request->getParam('teamId', ''); @@ -1021,7 +1035,7 @@ App::setResource('team', function (Document $project, Database $dbForPlatform, A return new Document([]); } - $team = Authorization::skip(fn () => $dbForPlatform->getDocument('teams', $teamId)); + $team = $authorization->skip(fn () => $dbForPlatform->getDocument('teams', $teamId)); return $team; } } @@ -1030,14 +1044,14 @@ App::setResource('team', function (Document $project, Database $dbForPlatform, A return new Document([]); } - $team = Authorization::skip(function () use ($dbForPlatform, $teamInternalId) { + $team = $authorization->skip(function () use ($dbForPlatform, $teamInternalId) { return $dbForPlatform->findOne('teams', [ Query::equal('$sequence', [$teamInternalId]), ]); }); return $team; -}, ['project', 'dbForPlatform', 'utopia', 'request']); +}, ['project', 'dbForPlatform', 'utopia', 'request', 'authorization']); App::setResource( 'isResourceBlocked', @@ -1075,7 +1089,7 @@ App::setResource('apiKey', function (Request $request, Document $project): ?Key App::setResource('executor', fn () => new Executor()); -App::setResource('resourceToken', function ($project, $dbForProject, $request) { +App::setResource('resourceToken', function ($project, $dbForProject, $request, Authorization $authorization) { $tokenJWT = $request->getParam('token'); if (!empty($tokenJWT) && !$project->isEmpty()) { // JWT authentication @@ -1093,7 +1107,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return new Document([]); } - $token = Authorization::skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId)); + $token = $authorization->skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId)); if ($token->isEmpty()) { return new Document([]); @@ -1111,7 +1125,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { } return match ($token->getAttribute('resourceType')) { - TOKENS_RESOURCE_TYPE_FILES => (function () use ($token, $dbForProject) { + TOKENS_RESOURCE_TYPE_FILES => (function () use ($token, $dbForProject, $authorization) { $sequences = explode(':', $token->getAttribute('resourceInternalId')); $ids = explode(':', $token->getAttribute('resourceId')); @@ -1122,7 +1136,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { $accessedAt = $token->getAttribute('accessedAt', 0); if (empty($accessedAt) || DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_RESOURCE_TOKEN_ACCESS)) > $accessedAt) { $token->setAttribute('accessedAt', DatabaseDateTime::now()); - Authorization::skip(fn () => $dbForProject->updateDocument('resourceTokens', $token->getId(), $token)); + $authorization->skip(fn () => $dbForProject->updateDocument('resourceTokens', $token->getId(), $token)); } return new Document([ @@ -1137,8 +1151,8 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { }; } return new Document([]); -}, ['project', 'dbForProject', 'request']); +}, ['project', 'dbForProject', 'request', 'authorization']); -App::setResource('transactionState', function (Database $dbForProject) { - return new TransactionState($dbForProject); -}, ['dbForProject']); +App::setResource('transactionState', function (Database $dbForProject, Authorization $authorization) { + return new TransactionState($dbForProject, $authorization); +}, ['dbForProject', 'authorization']); diff --git a/app/realtime.php b/app/realtime.php index fab0ce7561..fcc5329982 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -32,7 +32,6 @@ use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\Pools\Group; @@ -67,6 +66,7 @@ if (!function_exists('getConsoleDB')) { $adapter = new DatabasePool($pools->get('console')); $database = new Database($adapter, getCache()); $database + ->setDatabase(APP_DATABASE) ->setNamespace('_console') ->setMetadata('host', \gethostname()) ->setMetadata('project', '_console'); @@ -123,6 +123,7 @@ if (!function_exists('getProjectDB')) { } $database + ->setDatabase(APP_DATABASE) ->setMetadata('host', \gethostname()) ->setMetadata('project', $project->getId()); @@ -309,7 +310,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$statsDocume 'value' => '{}' ]); - $statsDocument = Authorization::skip(fn () => $database->createDocument('realtime', $document)); + $statsDocument = $database->getAuthorization()->skip(fn () => $database->createDocument('realtime', $document)); break; } catch (Throwable) { Console::warning("Collection not ready. Retrying connection ({$attempts})..."); @@ -339,7 +340,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$statsDocume ->setAttribute('timestamp', DateTime::now()) ->setAttribute('value', json_encode($payload)); - Authorization::skip(fn () => $database->updateDocument('realtime', $statsDocument->getId(), $statsDocument)); + $database->getAuthorization()->skip(fn () => $database->updateDocument('realtime', $statsDocument->getId(), $statsDocument)); } catch (Throwable $th) { $logError($th, "updateWorkerDocument"); } @@ -370,7 +371,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $payload = []; - $list = Authorization::skip(fn () => $database->find('realtime', [ + $list = $database->getAuthorization()->skip(fn () => $database->find('realtime', [ Query::greaterThan('timestamp', DateTime::addSeconds(new \DateTime(), -15)), ])); @@ -464,13 +465,13 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, if ($realtime->hasSubscriber($projectId, 'user:' . $userId)) { $connection = array_key_first(reset($realtime->subscriptions[$projectId]['user:' . $userId])); $consoleDatabase = getConsoleDB(); - $project = Authorization::skip(fn () => $consoleDatabase->getDocument('projects', $projectId)); + $project = $consoleDatabase->getAuthorization()->skip(fn () => $consoleDatabase->getDocument('projects', $projectId)); $database = getProjectDB($project); /** @var Appwrite\Utopia\Database\Documents\User $user */ $user = $database->getDocument('users', $userId); - $roles = $user->getRoles(); + $roles = $user->getRoles($database->getAuthorization()); $channels = $realtime->connections[$connection]['channels']; $realtime->unsubscribe($connection); @@ -526,6 +527,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, try { /** @var Document $project */ $project = $app->getResource('project'); + $authorization = $app->getResource('authorization'); /* * Project Check @@ -537,7 +539,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, if ( array_key_exists('realtime', $project->getAttribute('apis', [])) && !$project->getAttribute('apis', [])['realtime'] - && !(User::isPrivileged(Authorization::getRoles()) || User::isApp(Authorization::getRoles())) + && !(User::isPrivileged($authorization->getRoles()) || User::isApp($authorization->getRoles())) ) { throw new AppwriteException(AppwriteException::GENERAL_API_DISABLED); } @@ -573,7 +575,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, throw new Exception(Exception::REALTIME_POLICY_VIOLATION, $originValidator->getDescription()); } - $roles = $user->getRoles(); + $roles = $user->getRoles($authorization); $channels = Realtime::convertChannels($request->getQuery('channels', []), $user->getId()); @@ -586,6 +588,8 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, $realtime->subscribe($project->getId(), $connection, $roles, $channels); + $realtime->connections[$connection]['authorization'] = $authorization; + $user = empty($user->getId()) ? null : $response->output($user, Response::MODEL_ACCOUNT); $server->send([$connection], json_encode([ @@ -614,6 +618,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, $code = 500; } + $message = $th->getMessage(); // sanitize 0 && 5xx errors @@ -643,12 +648,19 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, $server->onMessage(function (int $connection, string $message) use ($server, $register, $realtime, $containerId) { try { $response = new Response(new SwooleResponse()); - $projectId = $realtime->connections[$connection]['projectId']; + $projectId = $realtime->connections[$connection]['projectId'] ?? null; + + // Get authorization from connection (stored during onOpen) + $authorization = $realtime->connections[$connection]['authorization'] ?? null; + $database = getConsoleDB(); + $database->setAuthorization($authorization); if ($projectId !== 'console') { - $project = Authorization::skip(fn () => $database->getDocument('projects', $projectId)); + $project = $authorization->skip(fn () => $database->getDocument('projects', $projectId)); + $database = getProjectDB($project); + $database->setAuthorization($authorization); } else { $project = null; } @@ -712,10 +724,19 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re throw new Exception(Exception::REALTIME_MESSAGE_FORMAT_INVALID, 'Session is not valid.'); } - $roles = $user->getRoles(); + $roles = $user->getRoles($database->getAuthorization()); $channels = Realtime::convertChannels(array_flip($realtime->connections[$connection]['channels']), $user->getId()); + + // Preserve authorization before subscribe overwrites the connection array + $authorization = $realtime->connections[$connection]['authorization'] ?? null; + $realtime->subscribe($realtime->connections[$connection]['projectId'], $connection, $roles, $channels); + // Restore authorization after subscribe + if ($authorization !== null) { + $realtime->connections[$connection]['authorization'] = $authorization; + } + $user = $response->output($user, Response::MODEL_ACCOUNT); $server->send([$connection], json_encode([ 'type' => 'response', diff --git a/app/worker.php b/app/worker.php index 3720fb85fe..ba8bf98568 100644 --- a/app/worker.php +++ b/app/worker.php @@ -49,19 +49,31 @@ use Utopia\System\System; use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Adapter\None as NoTelemetry; -Authorization::disable(); Runtime::enableCoroutine(); Server::setResource('register', fn () => $register); -Server::setResource('dbForPlatform', function (Cache $cache, Registry $register) { +Server::setResource('authorization', function () { + $authorization = new Authorization(); + $authorization->disable(); + return $authorization; +}, []); + +Server::setResource('dbForPlatform', function (Cache $cache, Registry $register, Authorization $authorization) { $pools = $register->get('pools'); $adapter = new DatabasePool($pools->get('console')); $dbForPlatform = new Database($adapter, $cache); - $dbForPlatform->setNamespace('_console'); - $dbForPlatform->setDocumentType('users', User::class); + + $dbForPlatform + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) + ->setNamespace('_console') + ->setDocumentType('users', User::class) + ; + + return $dbForPlatform; -}, ['cache', 'register']); +}, ['cache', 'register', 'authorization']); Server::setResource('project', function (Message $message, Database $dbForPlatform) { $payload = $message->getPayload() ?? []; @@ -74,7 +86,7 @@ Server::setResource('project', function (Message $message, Database $dbForPlatfo return $dbForPlatform->getDocument('projects', $project->getId()); }, ['message', 'dbForPlatform']); -Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Document $project, Database $dbForPlatform) { +Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Document $project, Database $dbForPlatform, Authorization $authorization) { if ($project->isEmpty() || $project->getId() === 'console') { return $dbForPlatform; } @@ -106,15 +118,18 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register, ->setNamespace('_' . $project->getSequence()); } - $database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); + $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) + ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); return $database; -}, ['cache', 'register', 'message', 'project', 'dbForPlatform']); +}, ['cache', 'register', 'message', 'project', 'dbForPlatform', 'authorization']); -Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { +Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, Authorization $authorization) { $databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools - return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases): Database { + return function (Document $project) use ($pools, $dbForPlatform, $cache, $authorization, &$databases): Database { if ($project->isEmpty() || $project->getId() === 'console') { return $dbForPlatform; } @@ -128,7 +143,7 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf if (isset($databases[$dsn->getHost()])) { $database = $databases[$dsn->getHost()]; - + $database->setAuthorization($authorization); $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); if (\in_array($dsn->getHost(), $sharedTables)) { @@ -165,15 +180,18 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf ->setNamespace('_' . $project->getSequence()); } - $database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); + $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) + ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); return $database; }; -}, ['pools', 'dbForPlatform', 'cache']); +}, ['pools', 'dbForPlatform', 'cache', 'authorization']); -Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { +Server::setResource('getLogsDB', function (Group $pools, Cache $cache, Authorization $authorization) { $database = null; - return function (?Document $project = null) use ($pools, $cache, $database) { + return function (?Document $project = null) use ($pools, $cache, $database, $authorization) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { $database->setTenant((int)$project->getSequence()); return $database; @@ -183,6 +201,8 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = new Database($adapter, $cache); $database + ->setDatabase(APP_DATABASE) + ->setAuthorization($authorization) ->setSharedTables(true) ->setNamespace('logsV1') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER) @@ -195,7 +215,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { return $database; }; -}, ['pools', 'cache']); +}, ['pools', 'cache', 'authorization']); Server::setResource('abuseRetention', function () { return time() - (int) System::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', 86400); // 1 day @@ -514,7 +534,8 @@ $worker ->inject('log') ->inject('pools') ->inject('project') - ->action(function (Throwable $error, ?Logger $logger, Log $log, Group $pools, Document $project) use ($worker, $queueName) { + ->inject('authorization') + ->action(function (Throwable $error, ?Logger $logger, Log $log, Group $pools, Document $project, Authorization $authorization) use ($worker, $queueName) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); if ($logger) { @@ -530,7 +551,7 @@ $worker $log->addExtra('file', $error->getFile()); $log->addExtra('line', $error->getLine()); $log->addExtra('trace', $error->getTraceAsString()); - $log->addExtra('roles', Authorization::getRoles()); + $log->addExtra('roles', $authorization->getRoles()); $isProduction = System::getEnv('_APP_ENV', 'development') === 'production'; $log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING); diff --git a/composer.json b/composer.json index 131455d206..f5bab03697 100644 --- a/composer.json +++ b/composer.json @@ -45,18 +45,18 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.19.*", "appwrite/php-clamav": "2.0.*", - "utopia-php/abuse": "1.*.*", + "utopia-php/abuse": "1.*", "utopia-php/analytics": "0.10.*", - "utopia-php/audit": "2.0.2-rc3", + "utopia-php/audit": "2.*", "utopia-php/auth": "0.5.*", "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", - "utopia-php/config": "1.*.*", - "utopia-php/database": "3.*.*", + "utopia-php/config": "1.*", + "utopia-php/database": "4.*", "utopia-php/detector": "0.2.*", - "utopia-php/domains": "0.9.*", + "utopia-php/domains": "0.11.*", "utopia-php/emails": "0.6.*", - "utopia-php/dns": "1.4.*", + "utopia-php/dns": "1.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.5.*", @@ -64,7 +64,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/logger": "0.6.*", "utopia-php/messaging": "0.20.*", - "utopia-php/migration": "1.3.*", + "utopia-php/migration": "1.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.8.*", @@ -72,7 +72,7 @@ "utopia-php/queue": "0.15.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", - "utopia-php/swoole": "0.8.*", + "utopia-php/swoole": "1.*", "utopia-php/system": "0.9.*", "utopia-php/telemetry": "0.1.*", "utopia-php/vcs": "0.13.*", diff --git a/composer.lock b/composer.lock index 7a7339fa08..8b60305dff 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": "ff3172688b600aa3c560131c9d9c5588", + "content-hash": "33da844fdf5648d1d1a027dfb6ae42bc", "packages": [ { "name": "adhocore/jwt", @@ -756,16 +756,16 @@ }, { "name": "google/protobuf", - "version": "v4.33.2", + "version": "v4.33.4", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318" + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/22d28025cda0d223a2e48c2e16c5284ecc9f5402", + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402", "shasum": "" }, "require": { @@ -794,9 +794,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.2" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.4" }, - "time": "2025-12-05T22:12:22+00:00" + "time": "2026-01-12T17:58:43+00:00" }, { "name": "league/csv", @@ -3455,25 +3455,25 @@ }, { "name": "utopia-php/abuse", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "3339d057c6bb1fa3e5ac5b2598923f6938425ec2" + "reference": "15cd5dbefa4453e8a2d90649a7078e242966ac3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/3339d057c6bb1fa3e5ac5b2598923f6938425ec2", - "reference": "3339d057c6bb1fa3e5ac5b2598923f6938425ec2", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/15cd5dbefa4453e8a2d90649a7078e242966ac3f", + "reference": "15cd5dbefa4453e8a2d90649a7078e242966ac3f", "shasum": "" }, "require": { - "appwrite/appwrite": "19.*.*", + "appwrite/appwrite": "19.*", "ext-curl": "*", "ext-pdo": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/database": "3.*.*" + "utopia-php/database": "4.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3501,9 +3501,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/1.2.0" + "source": "https://github.com/utopia-php/abuse/tree/1.2.1" }, - "time": "2026-01-05T21:29:10+00:00" + "time": "2026-01-15T02:09:49+00:00" }, { "name": "utopia-php/analytics", @@ -3553,23 +3553,23 @@ }, { "name": "utopia-php/audit", - "version": "2.0.2-rc3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "f60a298b516300f56a328403b334b7d62a96e7e7" + "reference": "1301ab2607667b9f86456f86895f3e26f8c0c9a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/f60a298b516300f56a328403b334b7d62a96e7e7", - "reference": "f60a298b516300f56a328403b334b7d62a96e7e7", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/1301ab2607667b9f86456f86895f3e26f8c0c9a7", + "reference": "1301ab2607667b9f86456f86895f3e26f8c0c9a7", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/database": "3.*", + "utopia-php/database": "4.*", "utopia-php/fetch": "0.5.*", - "utopia-php/validators": "0.1.*" + "utopia-php/validators": "0.2.*" }, "require-dev": { "laravel/pint": "1.*", @@ -3596,9 +3596,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/2.0.2-rc3" + "source": "https://github.com/utopia-php/audit/tree/2.0.4" }, - "time": "2026-01-06T15:32:52+00:00" + "time": "2026-01-14T07:22:46+00:00" }, { "name": "utopia-php/auth", @@ -3899,16 +3899,16 @@ }, { "name": "utopia-php/database", - "version": "3.6.1", + "version": "4.5.2", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7" + "reference": "8e6a033d4da09a2f2ac1f79fd85fcfa2da018d23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/c8c1b2f5770245dd4006e2680681e3efbe8b1fa7", - "reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/8e6a033d4da09a2f2ac1f79fd85fcfa2da018d23", + "reference": "8e6a033d4da09a2f2ac1f79fd85fcfa2da018d23", "shasum": "" }, "require": { @@ -3951,9 +3951,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/3.6.1" + "source": "https://github.com/utopia-php/database/tree/4.5.2" }, - "time": "2025-12-16T09:55:41+00:00" + "time": "2026-01-15T04:23:30+00:00" }, { "name": "utopia-php/detector", @@ -4002,22 +4002,22 @@ }, { "name": "utopia-php/dns", - "version": "1.4.1", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/utopia-php/dns.git", - "reference": "5daf8b683dad877491c4df84c6be24850b2f363b" + "reference": "a1f490ba425b1a5128e7aaa24eff560900812d21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/dns/zipball/5daf8b683dad877491c4df84c6be24850b2f363b", - "reference": "5daf8b683dad877491c4df84c6be24850b2f363b", + "url": "https://api.github.com/repos/utopia-php/dns/zipball/a1f490ba425b1a5128e7aaa24eff560900812d21", + "reference": "a1f490ba425b1a5128e7aaa24eff560900812d21", "shasum": "" }, "require": { "php": ">=8.3", - "utopia-php/console": "0.0.*", - "utopia-php/domains": "0.9.*", + "utopia-php/domains": "0.11.*", + "utopia-php/span": "1.0.*", "utopia-php/telemetry": "*", "utopia-php/validators": "0.*" }, @@ -4053,22 +4053,22 @@ ], "support": { "issues": "https://github.com/utopia-php/dns/issues", - "source": "https://github.com/utopia-php/dns/tree/1.4.1" + "source": "https://github.com/utopia-php/dns/tree/1.5.3" }, - "time": "2025-12-17T09:09:08+00:00" + "time": "2026-01-13T11:39:38+00:00" }, { "name": "utopia-php/domains", - "version": "0.9.2", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/domains.git", - "reference": "52b654f8a0e170bfa2e54cb47755b256822477c7" + "reference": "f333e23e721ca5cd3bd21063fa88304114b0467d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/domains/zipball/52b654f8a0e170bfa2e54cb47755b256822477c7", - "reference": "52b654f8a0e170bfa2e54cb47755b256822477c7", + "url": "https://api.github.com/repos/utopia-php/domains/zipball/f333e23e721ca5cd3bd21063fa88304114b0467d", + "reference": "f333e23e721ca5cd3bd21063fa88304114b0467d", "shasum": "" }, "require": { @@ -4115,9 +4115,9 @@ ], "support": { "issues": "https://github.com/utopia-php/domains/issues", - "source": "https://github.com/utopia-php/domains/tree/0.9.2" + "source": "https://github.com/utopia-php/domains/tree/0.11.0" }, - "time": "2025-11-26T12:16:36+00:00" + "time": "2026-01-13T09:40:08+00:00" }, { "name": "utopia-php/dsn", @@ -4168,22 +4168,22 @@ }, { "name": "utopia-php/emails", - "version": "0.6.4", + "version": "0.6.5", "source": { "type": "git", "url": "https://github.com/utopia-php/emails.git", - "reference": "fb2bd5c428e88f645b0f7ede0dd29ac0d120ec52" + "reference": "178e57a0f9a24139500c94ce73d166800197b6cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/emails/zipball/fb2bd5c428e88f645b0f7ede0dd29ac0d120ec52", - "reference": "fb2bd5c428e88f645b0f7ede0dd29ac0d120ec52", + "url": "https://api.github.com/repos/utopia-php/emails/zipball/178e57a0f9a24139500c94ce73d166800197b6cf", + "reference": "178e57a0f9a24139500c94ce73d166800197b6cf", "shasum": "" }, "require": { "php": ">=8.0", "utopia-php/cli": "^0.15", - "utopia-php/domains": "^0.9", + "utopia-php/domains": "^0.11", "utopia-php/fetch": "^0.5", "utopia-php/validators": "0.*" }, @@ -4222,9 +4222,9 @@ ], "support": { "issues": "https://github.com/utopia-php/emails/issues", - "source": "https://github.com/utopia-php/emails/tree/0.6.4" + "source": "https://github.com/utopia-php/emails/tree/0.6.5" }, - "time": "2025-12-18T16:36:50+00:00" + "time": "2026-01-13T09:55:59+00:00" }, { "name": "utopia-php/fetch", @@ -4267,23 +4267,23 @@ }, { "name": "utopia-php/framework", - "version": "0.33.36", + "version": "0.33.37", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "fd835ed77e1cdf327067ce4e650cce86304e7098" + "reference": "30a119d76531d89da9240496940c84fcd9e1758b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/fd835ed77e1cdf327067ce4e650cce86304e7098", - "reference": "fd835ed77e1cdf327067ce4e650cce86304e7098", + "url": "https://api.github.com/repos/utopia-php/http/zipball/30a119d76531d89da9240496940c84fcd9e1758b", + "reference": "30a119d76531d89da9240496940c84fcd9e1758b", "shasum": "" }, "require": { "php": ">=8.3", "utopia-php/compression": "0.1.*", "utopia-php/telemetry": "0.1.*", - "utopia-php/validators": "0.1.*" + "utopia-php/validators": "0.2.*" }, "require-dev": { "laravel/pint": "1.*", @@ -4309,9 +4309,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.36" + "source": "https://github.com/utopia-php/http/tree/0.33.37" }, - "time": "2026-01-12T07:32:29+00:00" + "time": "2026-01-13T10:10:21+00:00" }, { "name": "utopia-php/image", @@ -4516,16 +4516,16 @@ }, { "name": "utopia-php/migration", - "version": "1.3.13", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "c5e3f5e970e62e8f7db97b5b90baae2af800a715" + "reference": "52ca4234d8229b68e27e052248734a08784d9d3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/c5e3f5e970e62e8f7db97b5b90baae2af800a715", - "reference": "c5e3f5e970e62e8f7db97b5b90baae2af800a715", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/52ca4234d8229b68e27e052248734a08784d9d3d", + "reference": "52ca4234d8229b68e27e052248734a08784d9d3d", "shasum": "" }, "require": { @@ -4534,7 +4534,7 @@ "ext-openssl": "*", "php": ">=8.1", "utopia-php/console": "0.0.*", - "utopia-php/database": "3.*", + "utopia-php/database": "4.*", "utopia-php/dsn": "0.2.*", "utopia-php/storage": "0.18.*" }, @@ -4565,9 +4565,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.3.13" + "source": "https://github.com/utopia-php/migration/tree/1.4.3" }, - "time": "2026-01-07T14:48:05+00:00" + "time": "2026-01-13T09:51:08+00:00" }, { "name": "utopia-php/mongo", @@ -4954,6 +4954,49 @@ }, "time": "2021-03-10T10:45:22+00:00" }, + { + "name": "utopia-php/span", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/span.git", + "reference": "f2f6c499ded3a776e8019902e83d140ff0f89693" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/span/zipball/f2f6c499ded3a776e8019902e83d140ff0f89693", + "reference": "f2f6c499ded3a776e8019902e83d140ff0f89693", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "laravel/pint": "^1.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0", + "swoole/ide-helper": "^5.0" + }, + "suggest": { + "ext-swoole": "Required for coroutine-based storage" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Span\\": "src/Span/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Simple span tracing library for PHP with coroutine support", + "support": { + "issues": "https://github.com/utopia-php/span/issues", + "source": "https://github.com/utopia-php/span/tree/1.0.0" + }, + "time": "2026-01-12T20:05:10+00:00" + }, { "name": "utopia-php/storage", "version": "0.18.18", @@ -5014,22 +5057,22 @@ }, { "name": "utopia-php/swoole", - "version": "0.8.6", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/swoole.git", - "reference": "14b00277c35a258cb263706fd4e05c50368feb4f" + "reference": "95a937acb393dbf95cccba239d55886e2848ab0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/swoole/zipball/14b00277c35a258cb263706fd4e05c50368feb4f", - "reference": "14b00277c35a258cb263706fd4e05c50368feb4f", + "url": "https://api.github.com/repos/utopia-php/swoole/zipball/95a937acb393dbf95cccba239d55886e2848ab0b", + "reference": "95a937acb393dbf95cccba239d55886e2848ab0b", "shasum": "" }, "require": { "ext-swoole": "*", "php": ">=8.0", - "utopia-php/framework": "0.33.36" + "utopia-php/framework": "0.33.37" }, "require-dev": { "laravel/pint": "1.2.*", @@ -5059,9 +5102,9 @@ ], "support": { "issues": "https://github.com/utopia-php/swoole/issues", - "source": "https://github.com/utopia-php/swoole/tree/0.8.6" + "source": "https://github.com/utopia-php/swoole/tree/1.0.0" }, - "time": "2026-01-12T07:57:35+00:00" + "time": "2026-01-14T14:00:11+00:00" }, { "name": "utopia-php/system", @@ -5171,16 +5214,16 @@ }, { "name": "utopia-php/validators", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/validators.git", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080" + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/5c57d5b6cf964f8981807c1d3ea8df620c869080", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080", + "url": "https://api.github.com/repos/utopia-php/validators/zipball/30b6030a5b100fc1dff34506e5053759594b2a20", + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20", "shasum": "" }, "require": { @@ -5188,7 +5231,7 @@ }, "require-dev": { "laravel/pint": "1.*", - "phpstan/phpstan": "1.*", + "phpstan/phpstan": "2.*", "phpunit/phpunit": "11.*" }, "type": "library", @@ -5210,9 +5253,9 @@ ], "support": { "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.1.0" + "source": "https://github.com/utopia-php/validators/tree/0.2.0" }, - "time": "2025-11-18T11:05:46+00:00" + "time": "2026-01-13T09:16:51+00:00" }, { "name": "utopia-php/vcs", @@ -5439,16 +5482,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.8.9", + "version": "1.8.16", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "5fc210f7403f9ecfa068cd2a74210ec6e2a3cec1" + "reference": "e2963002b39f3aa24bd6bf61a78492e182397174" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5fc210f7403f9ecfa068cd2a74210ec6e2a3cec1", - "reference": "5fc210f7403f9ecfa068cd2a74210ec6e2a3cec1", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/e2963002b39f3aa24bd6bf61a78492e182397174", + "reference": "e2963002b39f3aa24bd6bf61a78492e182397174", "shasum": "" }, "require": { @@ -5484,9 +5527,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/1.8.9" + "source": "https://github.com/appwrite/sdk-generator/tree/1.8.16" }, - "time": "2026-01-02T12:09:51+00:00" + "time": "2026-01-15T08:16:15+00:00" }, { "name": "doctrine/annotations", @@ -8945,9 +8988,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/audit": 5 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docs/sdks/cli/CHANGELOG.md b/docs/sdks/cli/CHANGELOG.md index 9f1f02bbd0..b8dfc56dc5 100644 --- a/docs/sdks/cli/CHANGELOG.md +++ b/docs/sdks/cli/CHANGELOG.md @@ -1,5 +1,34 @@ # Change Log +## 13.0.0 + +- Mark release as stable +- Feat: add pull sync on destruction of remote resources (+ confirmation) +- Fix: refine zod schema to check string size +- Validate using zod schema during push cli command +- Maintain order of keys in local config + +## 13.0.0-rc.5 + +- Fix push all command not working correctly + +## 13.0.0-rc.4 + +- Fix CLI ES module import issues + +## 13.0.0-rc.3 + +- Add `Schema` class for programmatically pushing and pulling appwrite config +- Add client side db generation using `schema.db.generate()` command + +## 13.0.0-rc.2 + +- Fixes a lot of typescript errors throughout the codebase + +## 13.0.0-rc.1 + +- Migrates codebase from JavaScript to TypeScript + ## 12.0.1 Fix type generation for `point`, `lineString` and `polygon` columns diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index b370394c8b..9f5ade774a 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 20.1.1 + +* Fix boolean parameter not handled correctly in Client requests + ## 20.1.0 * Added ability to create columns and indexes synchronously while creating a table diff --git a/docs/sdks/flutter/CHANGELOG.md b/docs/sdks/flutter/CHANGELOG.md index 834c926977..3be014dfc5 100644 --- a/docs/sdks/flutter/CHANGELOG.md +++ b/docs/sdks/flutter/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 20.3.3 + +* Fix boolean parameter not handled correctly in Client requests + ## 20.3.2 * Fix OAuth2 browser infinite redirect issue diff --git a/src/Appwrite/Databases/TransactionState.php b/src/Appwrite/Databases/TransactionState.php index 23dc6fc2e9..8e098774e6 100644 --- a/src/Appwrite/Databases/TransactionState.php +++ b/src/Appwrite/Databases/TransactionState.php @@ -20,10 +20,12 @@ use Utopia\Database\Validator\Authorization; class TransactionState { private Database $dbForProject; - - public function __construct(Database $dbForProject) + private Authorization $authorization; + /** @var Authorization $authorization */ + public function __construct(Database $dbForProject, Authorization $authorization) { $this->dbForProject = $dbForProject; + $this->authorization = $authorization; } @@ -342,12 +344,12 @@ class TransactionState */ private function getTransactionState(string $transactionId): array { - $transaction = Authorization::skip(fn () => $this->dbForProject->getDocument('transactions', $transactionId)); + $transaction = $this->authorization->skip(fn () => $this->dbForProject->getDocument('transactions', $transactionId)); if ($transaction->isEmpty() || $transaction->getAttribute('status') !== 'pending') { return []; } - $operations = Authorization::skip(fn () => $this->dbForProject->find('transactionLogs', [ + $operations = $this->authorization->skip(fn () => $this->dbForProject->find('transactionLogs', [ Query::equal('transactionInternalId', [$transaction->getSequence()]), Query::orderAsc(), Query::limit(PHP_INT_MAX) diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index bc37924db6..ea51225ba6 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -100,8 +100,6 @@ abstract class Migration public function __construct() { - Authorization::disable(); - Authorization::setDefaultStatus(false); $this->collections = Config::getParam('collections', []); @@ -129,6 +127,7 @@ abstract class Migration Document $project, Database $dbForProject, Database $dbForPlatform, + Authorization $authorization, ?callable $getProjectDB = null ): self { $this->project = $project; @@ -136,6 +135,9 @@ abstract class Migration $this->dbForPlatform = $dbForPlatform; $this->getProjectDB = $getProjectDB; + $authorization->disable(); + $authorization->setDefaultStatus(false); + return $this; } diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Action.php b/src/Appwrite/Platform/Modules/Avatars/Http/Action.php index 1ff2f8f706..bf7d01764f 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Action.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Action.php @@ -21,7 +21,7 @@ class Action extends PlatformAction return \dirname(__DIR__, 6); } - protected function avatarCallback(string $type, string $code, int $width, int $height, int $quality, Response $response): void + protected function avatar(string $type, string $code, int $width, int $height, int $quality, Response $response): void { $code = \strtolower($code); $type = \strtolower($type); @@ -58,10 +58,10 @@ class Action extends PlatformAction unset($image); } - protected function getUserGitHub(string $userId, Document $project, Database $dbForProject, Database $dbForPlatform, ?Logger $logger): array + protected function getUserGitHub(string $userId, Document $project, Database $dbForProject, Database $dbForPlatform, ?Logger $logger, Authorization $authorization): array { try { - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); $sessions = $user->getAttribute('sessions', []); @@ -112,7 +112,7 @@ class Action extends PlatformAction ->setAttribute('providerRefreshToken', $refreshToken) ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$oauth2->getAccessTokenExpiry(''))); - Authorization::skip(fn () => $dbForProject->updateDocument('sessions', $gitHubSession->getId(), $gitHubSession)); + $authorization->skip(fn () => $dbForProject->updateDocument('sessions', $gitHubSession->getId(), $gitHubSession)); $dbForProject->purgeCachedDocument('users', $user->getId()); } catch (Throwable $err) { @@ -120,7 +120,7 @@ class Action extends PlatformAction do { $previousAccessToken = $gitHubSession->getAttribute('providerAccessToken'); - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); $sessions = $user->getAttribute('sessions', []); $gitHubSession = new Document(); diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Browsers/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Browsers/Get.php index 04648752b5..637ea647ef 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Browsers/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Browsers/Get.php @@ -59,6 +59,6 @@ class Get extends Action public function action(string $code, int $width, int $height, int $quality, Response $response) { - $this->avatarCallback('browsers', $code, $width, $height, $quality, $response); + $this->avatar('browsers', $code, $width, $height, $quality, $response); } } diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Back/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Back/Get.php index 1c0de4001e..a6a013ef21 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Back/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Back/Get.php @@ -53,12 +53,13 @@ class Get extends Action ->inject('contributors') ->inject('employees') ->inject('logger') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) + public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger, Authorization $authorization) { - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -68,7 +69,7 @@ class Get extends Action $userId = $user->getId(); $email = $user->getAttribute('email', ''); - $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); + $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger, $authorization); $githubId = $gitHub['id'] ?? ''; $isHero = \array_key_exists($email, $heroes); diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Front/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Front/Get.php index 9d53991dd6..f8e7a35b05 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Front/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/Front/Get.php @@ -53,12 +53,13 @@ class Get extends Action ->inject('contributors') ->inject('employees') ->inject('logger') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) + public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger, Authorization $authorization) { - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -69,7 +70,7 @@ class Get extends Action $email = $user->getAttribute('email', ''); $createdAt = new \DateTime($user->getCreatedAt()); - $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); + $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger, $authorization); $githubName = $gitHub['name'] ?? ''; $githubId = $gitHub['id'] ?? ''; diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/OG/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/OG/Get.php index f7c983db78..37776a3466 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/OG/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Cards/Cloud/OG/Get.php @@ -53,12 +53,13 @@ class Get extends Action ->inject('contributors') ->inject('employees') ->inject('logger') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) + public function action(string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForPlatform, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger, Authorization $authorization) { - $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); + $user = $authorization->skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -73,7 +74,7 @@ class Get extends Action $email = $user->getAttribute('email', ''); $createdAt = new \DateTime($user->getCreatedAt()); - $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); + $gitHub = $this->getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger, $authorization); $githubName = $gitHub['name'] ?? ''; $githubId = $gitHub['id'] ?? ''; diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/CreditCards/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/CreditCards/Get.php index 5d3429b377..87357f14c7 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/CreditCards/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/CreditCards/Get.php @@ -59,6 +59,6 @@ class Get extends Action public function action(string $code, int $width, int $height, int $quality, Response $response) { - $this->avatarCallback('credit-cards', $code, $width, $height, $quality, $response); + $this->avatar('credit-cards', $code, $width, $height, $quality, $response); } } diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Flags/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Flags/Get.php index c3960c134e..8230b15f50 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Flags/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Flags/Get.php @@ -59,6 +59,6 @@ class Get extends Action public function action(string $code, int $width, int $height, int $quality, Response $response) { - $this->avatarCallback('flags', $code, $width, $height, $quality, $response); + $this->avatar('flags', $code, $width, $height, $quality, $response); } } diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index 47afc90986..33b69dd589 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -13,6 +13,7 @@ use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Swoole\Request; use Utopia\System\System; @@ -142,7 +143,7 @@ class Base extends Action return $deployment; } - public function redeployVcsSite(Request $request, Document $site, Document $project, Document $installation, Database $dbForProject, Database $dbForPlatform, Build $queueForBuilds, Document $template, GitHub $github, bool $activate, string $referenceType = 'branch', string $reference = ''): Document + public function redeployVcsSite(Request $request, Document $site, Document $project, Document $installation, Database $dbForProject, Database $dbForPlatform, Build $queueForBuilds, Document $template, GitHub $github, bool $activate, Authorization $authorization, string $referenceType = 'branch', string $reference = ''): Document { $deploymentId = ID::unique(); $providerInstallationId = $installation->getAttribute('providerInstallationId', ''); @@ -239,7 +240,7 @@ class Base extends Action $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; $ruleId = $isMd5 ? md5($domain) : ID::unique(); - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -265,7 +266,7 @@ class Base extends Action $domain = "commit-" . substr($commitDetails['commitHash'], 0, 16) . ".{$sitesDomain}"; $ruleId = md5($domain); try { - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -302,7 +303,7 @@ class Base extends Action $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -328,6 +329,8 @@ class Base extends Action } } + $this->updateEmptyManualRule($project, $site, $deployment, $dbForPlatform, $authorization); + $queueForBuilds ->setType(BUILD_TYPE_DEPLOYMENT) ->setResource($site) @@ -336,4 +339,34 @@ class Base extends Action return $deployment; } + + /** + * Update empty manual rule for deployment. + * In case of first deployment, deployment ID will be empty in the rules, so we need to update it here. + * + * @param \Utopia\Database\Document $project + * @param \Utopia\Database\Document $resource + * @param \Utopia\Database\Document $deployment + * @param \Utopia\Database\Database $dbForPlatform + * @return void + */ + public static function updateEmptyManualRule(Document $project, Document $resource, Document $deployment, Database $dbForPlatform, Authorization $authorization) + { + $resourceType = $resource->getCollection() === 'sites' ? 'site' : 'function'; + + $queries = [ + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), + Query::equal('deploymentResourceType', [$resourceType]), + Query::equal('deploymentId', ['']), + Query::equal('type', ['deployment']), + Query::equal('trigger', ['manual']), + ]; + $dbForPlatform->forEach('rules', function (Document $rule) use ($deployment, $dbForPlatform, $authorization) { + $authorization->skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ]))); + }, $queries); + } } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php index aa43b12125..1468bf71ac 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php @@ -60,6 +60,7 @@ class Get extends Action ->inject('response') ->inject('dbForPlatform') ->inject('platform') + ->inject('authorization') ->callback($this->action(...)); } @@ -68,7 +69,8 @@ class Get extends Action string $type, Response $response, Database $dbForPlatform, - array $platform + array $platform, + Authorization $authorization, ) { $domains = $platform['hostnames'] ?? []; if ($type === 'rules') { @@ -121,7 +123,7 @@ class Get extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Domain may not start with http:// or https://.'); } - $document = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ + $document = $authorization->skip(fn () => $dbForPlatform->findOne('rules', [ Query::equal('domain', [$value]), ])); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php index 83a401a35e..e2df5d92e6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Action.php @@ -292,7 +292,7 @@ abstract class Action extends UtopiaAction }; } - protected function createAttribute(string $databaseId, string $collectionId, Document $attribute, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): Document + protected function createAttribute(string $databaseId, string $collectionId, Document $attribute, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): Document { $key = $attribute->getAttribute('key'); $type = $attribute->getAttribute('type', ''); @@ -310,7 +310,7 @@ abstract class Action extends UtopiaAction throw new Exception($this->getSpatialTypeNotSupportedException(), params: [$type]); } - $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $db = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); @@ -371,7 +371,7 @@ abstract class Action extends UtopiaAction \in_array($attribute->getAttribute('type'), Database::SPATIAL_TYPES) && $attribute->getAttribute('required') ) { - $hasData = !Authorization::skip(fn () => $dbForProject + $hasData = !$authorization->skip(fn () => $dbForProject ->findOne('database_' . $db->getSequence() . '_collection_' . $collection->getSequence())) ->isEmpty(); @@ -472,9 +472,9 @@ abstract class Action extends UtopiaAction return $attribute; } - protected function updateAttribute(string $databaseId, string $collectionId, string $key, Database $dbForProject, Event $queueForEvents, string $type, int $size = null, string $filter = null, string|bool|int|float|array $default = null, bool $required = null, int|float|null $min = null, int|float|null $max = null, array $elements = null, array $options = [], string $newKey = null): Document + protected function updateAttribute(string $databaseId, string $collectionId, string $key, Database $dbForProject, Event $queueForEvents, Authorization $authorization, string $type, int $size = null, string $filter = null, string|bool|int|float|array $default = null, bool $required = null, int|float|null $min = null, int|float|null $max = null, array $elements = null, array $options = [], string $newKey = null): Document { - $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $db = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php index f04532aeee..442461fdd3 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -69,10 +70,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, @@ -81,7 +83,7 @@ class Create extends Action 'required' => $required, 'default' => $default, 'array' => $array, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $response ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php index 003b4227c9..92324aae70 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Boolean/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -68,10 +69,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?bool $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -79,6 +81,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_BOOLEAN, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php index c2982445a4..bd3108a871 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; @@ -70,10 +71,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute( $databaseId, @@ -90,7 +92,8 @@ class Create extends Action $response, $dbForProject, $queueForDatabase, - $queueForEvents + $queueForEvents, + $authorization ); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php index 984d4b0245..2518875424 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Datetime/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_DATETIME, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php index 649cde10aa..37ae2a7bfe 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php @@ -67,12 +67,13 @@ class Delete extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { - $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $db = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php index b36072eb75..a36e264e50 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Create.php @@ -13,6 +13,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -70,10 +71,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute( $databaseId, @@ -90,7 +92,8 @@ class Create extends Action $response, $dbForProject, $queueForDatabase, - $queueForEvents + $queueForEvents, + $authorization ); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php index 382f16b469..609a337625 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Email/Update.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_STRING, filter: APP_DATABASE_ATTRIBUTE_EMAIL, default: $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php index 9145191b0c..3c47d1fdfe 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Create.php @@ -13,6 +13,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -73,10 +74,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, array $elements, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, array $elements, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { if (!is_null($default) && !\in_array($default, $elements, true)) { throw new Exception($this->getInvalidValueException(), 'Default value not found in elements'); @@ -98,7 +100,8 @@ class Create extends Action $response, $dbForProject, $queueForDatabase, - $queueForEvents + $queueForEvents, + $authorization ); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php index 2f47eb0cc6..5bea5230c0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Enum/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -71,10 +72,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?array $elements, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?array $elements, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -82,6 +84,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_STRING, filter: APP_DATABASE_ATTRIBUTE_ENUM, default: $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php index 56d8874794..0dc11bd76c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Create.php @@ -13,6 +13,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -74,10 +75,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $min ??= -PHP_FLOAT_MAX; $max ??= PHP_FLOAT_MAX; @@ -100,7 +102,7 @@ class Create extends Action 'array' => $array, 'format' => APP_DATABASE_ATTRIBUTE_FLOAT_RANGE, 'formatOptions' => ['min' => $min, 'max' => $max], - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $formatOptions = $attribute->getAttribute('formatOptions', []); if (!empty($formatOptions)) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php index 330c649f27..20b5c0767d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Float/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -71,10 +72,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -82,6 +84,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_FLOAT, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php index 3a8eece531..436b22c6c9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Get.php @@ -68,12 +68,13 @@ class Get extends Action ->param('key', '', new Key(), 'Attribute Key.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php index 2340d1d55d..2adf3977f4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -70,10 +71,11 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute( $databaseId, @@ -90,7 +92,8 @@ class Create extends Action $response, $dbForProject, $queueForDatabase, - $queueForEvents + $queueForEvents, + $authorization ); $response diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php index 236dbf7f83..eccf18b005 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/IP/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_STRING, filter: APP_DATABASE_ATTRIBUTE_IP, default: $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php index 30f58097ce..0989bb2904 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Create.php @@ -13,6 +13,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -66,18 +67,19 @@ class Create extends Action ->param('collectionId', '', new UID(), 'Collection ID.') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new Nullable(new Integer()), 'Minimum value', true) - ->param('max', null, new Nullable(new Integer()), 'Maximum value', true) - ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when attribute is required.', true) + ->param('min', null, new Nullable(new Integer(false, 64)), 'Minimum value', true) + ->param('max', null, new Nullable(new Integer(false, 64)), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer(false, 64)), 'Default value. Cannot be set when attribute is required.', true) ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $min ??= \PHP_INT_MIN; $max ??= \PHP_INT_MAX; @@ -102,7 +104,7 @@ class Create extends Action 'array' => $array, 'format' => APP_DATABASE_ATTRIBUTE_INT_RANGE, 'formatOptions' => ['min' => $min, 'max' => $max], - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $formatOptions = $attribute->getAttribute('formatOptions', []); if (!empty($formatOptions)) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php index 67c371c69d..57797d3e03 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -64,17 +65,18 @@ class Update extends Action ->param('collectionId', '', new UID(), 'Collection ID.') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new Nullable(new Integer()), 'Minimum value', true) - ->param('max', null, new Nullable(new Integer()), 'Maximum value', true) - ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when attribute is required.') + ->param('min', null, new Nullable(new Integer(false, 64)), 'Minimum value', true) + ->param('max', null, new Nullable(new Integer(false, 64)), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer(false, 64)), 'Default value. Cannot be set when attribute is required.') ->param('newKey', null, new Nullable(new Key()), 'New Attribute Key.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -82,6 +84,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_INTEGER, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php index f0fd728902..fc846957b0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,17 +70,18 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_LINESTRING, 'required' => $required, 'default' => $default - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $response ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php index 3407da2b34..8fff545921 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Line/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_LINESTRING, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php index f2e4d19267..a89c21581d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,17 +70,18 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POINT, 'required' => $required, 'default' => $default, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $response ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php index 86e78e56e3..9561fe6b96 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Point/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_POINT, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php index 4c49b21050..54da3ac604 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,17 +70,18 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, 'type' => Database::VAR_POLYGON, 'required' => $required, 'default' => $default, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $response ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php index 0dbb117cec..b82a3d4be0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Polygon/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Spatial; use Utopia\Database\Validator\UID; @@ -69,10 +70,11 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -80,6 +82,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_POLYGON, default: $default, required: $required, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php index b43568a968..615e64dfd7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Create.php @@ -83,16 +83,17 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $relatedCollectionId, string $type, bool $twoWay, ?string $key, ?string $twoWayKey, string $onDelete, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $relatedCollectionId, string $type, bool $twoWay, ?string $key, ?string $twoWayKey, string $onDelete, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { $key ??= $relatedCollectionId; $twoWayKeyWasProvided = $twoWayKey !== null; $twoWayKey ??= $collectionId; - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } @@ -154,7 +155,7 @@ class Create extends Action 'twoWayKey' => $twoWayKey, 'onDelete' => $onDelete, ] - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); foreach ($attribute->getAttribute('options', []) as $k => $option) { $attribute->setAttribute($k, $option); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php index feed58a4ff..d180131a44 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Relationship/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -71,6 +72,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -82,7 +84,8 @@ class Update extends Action ?string $newKey, UtopiaResponse $response, Database $dbForProject, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -90,6 +93,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_RELATIONSHIP, required: false, options: [ diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php index b42558f063..b3fe03cace 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Create.php @@ -14,6 +14,7 @@ use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\App; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -77,6 +78,7 @@ class Create extends Action ->inject('queueForDatabase') ->inject('queueForEvents') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -93,7 +95,8 @@ class Create extends Action Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, - array $plan + array $plan, + Authorization $authorization ): void { if (!App::isDevelopment() && $encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Encrypted string ' . $this->getSDKGroup() . ' are not available on your plan. Please upgrade to create encrypted string ' . $this->getSDKGroup() . '.'); @@ -132,7 +135,8 @@ class Create extends Action $response, $dbForProject, $queueForDatabase, - $queueForEvents + $queueForEvents, + $authorization ); $attribute->setAttribute('encrypt', $encrypt); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php index 53ea2a0e03..37547f3da8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/String/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -72,6 +73,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -85,7 +87,8 @@ class Update extends Action ?string $newKey, UtopiaResponse $response, Database $dbForProject, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ): void { $attribute = $this->updateAttribute( databaseId: $databaseId, @@ -93,6 +96,7 @@ class Update extends Action key: $key, dbForProject: $dbForProject, queueForEvents: $queueForEvents, + authorization: $authorization, type: Database::VAR_STRING, size: $size, default: $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php index 7529845016..ed1a23acf5 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -70,6 +71,7 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -83,7 +85,8 @@ class Create extends Action UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ): void { $attribute = $this->createAttribute($databaseId, $collectionId, new Document([ 'key' => $key, @@ -93,7 +96,7 @@ class Create extends Action 'default' => $default, 'array' => $array, 'format' => APP_DATABASE_ATTRIBUTE_URL, - ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); + ]), $response, $dbForProject, $queueForDatabase, $queueForEvents, $authorization); $response ->setStatusCode(SwooleResponse::STATUS_CODE_ACCEPTED) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php index 9ba8ebb859..08f7a26fd9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/URL/Update.php @@ -11,6 +11,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response as UtopiaResponse; use Utopia\Database\Database; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -69,6 +70,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -81,7 +83,8 @@ class Update extends Action ?string $newKey, UtopiaResponse $response, Database $dbForProject, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ): void { $attribute = $this->updateAttribute( $databaseId, @@ -89,6 +92,7 @@ class Update extends Action $key, $dbForProject, $queueForEvents, + $authorization, type: Database::VAR_STRING, filter: APP_DATABASE_ATTRIBUTE_URL, default: $default, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php index 6bfe5f8913..61c5b295cf 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/XList.php @@ -64,12 +64,13 @@ class XList extends Action ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, array $queries, bool $includeTotal, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $collectionId, array $queries, bool $includeTotal, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php index 724f40f00e..d0e9539ad4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Create.php @@ -85,12 +85,13 @@ class Create extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, array $attributes, array $indexes, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, array $attributes, array $indexes, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); @@ -185,7 +186,13 @@ class Create extends Action $dbForProject->getAdapter()->getSupportForVectors(), $dbForProject->getAdapter()->getSupportForAttributes(), $dbForProject->getAdapter()->getSupportForMultipleFulltextIndexes(), - $dbForProject->getAdapter()->getSupportForIdenticalIndexes() + $dbForProject->getAdapter()->getSupportForIdenticalIndexes(), + $dbForProject->getAdapter()->getSupportForObjectIndexes(), + $dbForProject->getAdapter()->getSupportForTrigramIndex(), + $dbForProject->getAdapter()->getSupportForSpatialAttributes(), + $dbForProject->getAdapter()->getSupportForIndex(), + $dbForProject->getAdapter()->getSupportForUniqueIndex(), + $dbForProject->getAdapter()->getSupportForFulltextIndex(), ); foreach ($collectionIndexes as $indexDoc) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php index af36649061..fd2c419954 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Delete.php @@ -64,12 +64,13 @@ class Delete extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php index f16d00998d..ec65135a05 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php @@ -258,9 +258,9 @@ abstract class Action extends DatabasesAction Document $collection, Document $document, Database $dbForProject, - /* options */ array &$collectionsCache, + Authorization $authorization, ?int &$operations = null, ): bool { @@ -297,7 +297,7 @@ abstract class Action extends DatabasesAction $relatedCollectionId = $relationship->getAttribute('relatedCollection'); if (!isset($collectionsCache[$relatedCollectionId])) { - $relatedCollectionDoc = Authorization::skip( + $relatedCollectionDoc = $authorization->skip( fn () => $dbForProject->getDocument( 'database_' . $database->getSequence(), $relatedCollectionId @@ -323,7 +323,8 @@ abstract class Action extends DatabasesAction document: $relation, dbForProject: $dbForProject, collectionsCache: $collectionsCache, - operations: $operations + operations: $operations, + authorization: $authorization ); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php index 53831f0fc5..16b7bd1b25 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php @@ -85,20 +85,21 @@ class Decrement extends Action ->inject('queueForEvents') ->inject('queueForStatsUsage') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $min, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, array $plan): void + public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $min, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, array $plan, Authorization $authorization): void { - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty()) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); } @@ -106,7 +107,7 @@ class Decrement extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty() || $transaction->getAttribute('status', '') !== 'pending') { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Invalid or non‑pending transaction'); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php index ea680db3b1..7adae7633b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Increment.php @@ -85,20 +85,21 @@ class Increment extends Action ->inject('queueForEvents') ->inject('queueForStatsUsage') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $max, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, array $plan): void + public function action(string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $max, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, array $plan, Authorization $authorization): void { - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty()) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); } @@ -106,7 +107,7 @@ class Increment extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty() || $transaction->getAttribute('status', '') !== 'pending') { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Invalid or non‑pending transaction'); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php index 6ec06f5c8a..bbc63da499 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php @@ -24,6 +24,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; @@ -132,9 +133,10 @@ class Create extends Action ->inject('queueForFunctions') ->inject('queueForWebhooks') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $documentId, string $collectionId, string|array $data, ?array $permissions, ?array $documents, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan): void + public function action(string $databaseId, string $documentId, string $collectionId, string|array $data, ?array $permissions, ?array $documents, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, array $plan, Authorization $authorization): void { $data = \is_string($data) ? \json_decode($data, true) @@ -178,19 +180,19 @@ class Create extends Action $documents = [$data]; } - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($isBulk && !$isAPIKey && !$isPrivilegedUser) { throw new Exception(Exception::GENERAL_UNAUTHORIZED_SCOPE); } - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); } @@ -204,7 +206,7 @@ class Create extends Action throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Bulk create is not supported for ' . $this->getSDKNamespace() .' with relationship ' . $this->getStructureContext()); } - $setPermissions = function (Document $document, ?array $permissions) use ($user, $isAPIKey, $isPrivilegedUser, $isBulk) { + $setPermissions = function (Document $document, ?array $permissions) use ($user, $isAPIKey, $isPrivilegedUser, $isBulk, $dbForProject, $authorization) { $allowedPermissions = [ Database::PERMISSION_READ, Database::PERMISSION_UPDATE, @@ -247,8 +249,8 @@ class Create extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', Authorization::getRoles()) . ')'); + if (!$authorization->hasRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $authorization->getRoles()) . ')'); } } } @@ -259,21 +261,25 @@ class Create extends Action $operations = 0; - $checkPermissions = function (Document $collection, Document $document, string $permission) use ($isAPIKey, $isPrivilegedUser, &$checkPermissions, $dbForProject, $database, &$operations) { + $checkPermissions = function (Document $collection, Document $document, string $permission) use ($isAPIKey, $isPrivilegedUser, &$checkPermissions, $dbForProject, $database, &$operations, $authorization) { $operations++; $documentSecurity = $collection->getAttribute('documentSecurity', false); - $validator = new Authorization($permission); - $valid = $validator->isValid($collection->getPermissionsByType($permission)); - if (($permission === Database::PERMISSION_UPDATE && !$documentSecurity) || !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + $validCollection = $authorization->isValid( + new Input($permission, $collection->getPermissionsByType($permission)) + ); + if (($permission === Database::PERMISSION_UPDATE && !$documentSecurity) || !$validCollection) { + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } if ($permission === Database::PERMISSION_UPDATE) { - $valid = $valid || $validator->isValid($document->getUpdate()); + $validDocument = $authorization->isValid( + new Input($permission, $document->getUpdate()) + ); + $valid = $validCollection || $validDocument; if ($documentSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } } @@ -298,7 +304,7 @@ class Create extends Action } $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( + $relatedCollection = $authorization->skip( fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); @@ -314,7 +320,7 @@ class Create extends Action if ($relation instanceof Document) { $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); - $current = Authorization::skip( + $current = $authorization->skip( fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId()) ); @@ -369,7 +375,7 @@ class Create extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -468,6 +474,7 @@ class Create extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, + authorization: $authorization ); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php index faae638c88..7acf8e386e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Delete.php @@ -83,6 +83,7 @@ class Delete extends Action ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -97,18 +98,19 @@ class Delete extends Action Event $queueForEvents, StatsUsage $queueForStatsUsage, TransactionState $transactionState, - array $plan + array $plan, + Authorization $authorization ): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); @@ -121,7 +123,7 @@ class Delete extends Action // Use transaction-aware document retrieval to see changes from same transaction $document = $transactionState->getDocument($collectionTableId, $documentId, $transactionId); } else { - $document = Authorization::skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); + $document = $authorization->skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); } if ($document->isEmpty()) { @@ -131,7 +133,7 @@ class Delete extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -205,6 +207,7 @@ class Delete extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, + authorization: $authorization ); $queueForStatsUsage diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php index f560267d4b..cb8b0dd42e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Get.php @@ -70,20 +70,21 @@ class Get extends Action ->inject('dbForProject') ->inject('queueForStatsUsage') ->inject('transactionState') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, array $queries, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, TransactionState $transactionState): void + public function action(string $databaseId, string $collectionId, string $documentId, array $queries, ?string $transactionId, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, TransactionState $transactionState, Authorization $authorization): void { - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); @@ -125,6 +126,7 @@ class Get extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, + authorization: $authorization, operations: $operations ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php index a4dd38ef67..2f5579f0ca 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Logs/XList.php @@ -72,13 +72,14 @@ class XList extends Action ->inject('dbForProject') ->inject('locale') ->inject('geodb') + ->inject('authorization') ->inject('audit') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb, Audit $audit): void + public function action(string $databaseId, string $collectionId, string $documentId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb, Authorization $authorization, Audit $audit): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php index 707857347a..a92d8ec180 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php @@ -87,10 +87,11 @@ class Update extends Action ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?string $transactionId, ?\DateTime $requestTimestamp, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, TransactionState $transactionState, array $plan): void + public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?string $transactionId, ?\DateTime $requestTimestamp, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, TransactionState $transactionState, array $plan, Authorization $authorization): void { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array @@ -98,16 +99,16 @@ class Update extends Action throw new Exception($this->getMissingPayloadException()); } - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); @@ -125,7 +126,7 @@ class Update extends Action // Use transaction-aware document retrieval to see changes from same transaction $document = $transactionState->getDocument($collectionTableId, $documentId, $transactionId); } else { - $document = Authorization::skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); + $document = $authorization->skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); } if ($document->isEmpty()) { @@ -140,7 +141,7 @@ class Update extends Action ]); // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { foreach (Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { @@ -153,7 +154,7 @@ class Update extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { + if (!$authorization->hasRole($role)) { throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); } } @@ -171,7 +172,7 @@ class Update extends Action $operations = 0; - $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations) { + $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations, $authorization) { $operations++; $relationships = \array_filter( @@ -195,7 +196,7 @@ class Update extends Action } $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( + $relatedCollection = $authorization->skip( fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); @@ -212,7 +213,7 @@ class Update extends Action if ($relation instanceof Document) { $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); - $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( + $oldDocument = $authorization->skip(fn () => $dbForProject->getDocument( 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId() )); @@ -249,7 +250,7 @@ class Update extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -340,6 +341,7 @@ class Update extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, + authorization: $authorization, ); $response->dynamic($document, $this->getResponseModel()); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php index b32871add2..62e59dd010 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php @@ -91,10 +91,11 @@ class Upsert extends Action ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?string $transactionId, ?\DateTime $requestTimestamp, UtopiaResponse $response, Document $user, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, TransactionState $transactionState, array $plan): void + public function action(string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?string $transactionId, ?\DateTime $requestTimestamp, UtopiaResponse $response, Document $user, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage, TransactionState $transactionState, array $plan, Authorization $authorization): void { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array @@ -106,15 +107,15 @@ class Upsert extends Action throw new Exception($this->getMissingPayloadException()); } - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); } @@ -139,7 +140,7 @@ class Upsert extends Action // Use transaction-aware document retrieval to see changes from same transaction $oldDocument = $transactionState->getDocument($collectionTableId, $documentId, $transactionId); } else { - $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); + $oldDocument = $authorization->skip(fn () => $dbForProject->getDocument($collectionTableId, $documentId)); } if ($oldDocument->isEmpty()) { if (!empty($user->getId())) { @@ -155,7 +156,7 @@ class Upsert extends Action } // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); if (!$isAPIKey && !$isPrivilegedUser && !\is_null($permissions)) { foreach (Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { @@ -168,7 +169,7 @@ class Upsert extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { + if (!$authorization->hasRole($role)) { throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); } } @@ -181,7 +182,7 @@ class Upsert extends Action $newDocument = new Document($data); $operations = 0; - $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations) { + $setCollection = (function (Document $collection, Document $document) use ($isAPIKey, $isPrivilegedUser, &$setCollection, $dbForProject, $database, &$operations, $authorization) { $operations++; $relationships = \array_filter( @@ -205,7 +206,7 @@ class Upsert extends Action } $relatedCollectionId = $relationship->getAttribute('relatedCollection'); - $relatedCollection = Authorization::skip( + $relatedCollection = $authorization->skip( fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); @@ -222,7 +223,7 @@ class Upsert extends Action if ($relation instanceof Document) { $relation = $this->removeReadonlyAttributes($relation, $isAPIKey || $isPrivilegedUser); - $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( + $oldDocument = $authorization->skip(fn () => $dbForProject->getDocument( 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId() )); @@ -259,7 +260,7 @@ class Upsert extends Action // Handle transaction staging if ($transactionId !== null) { $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -361,6 +362,7 @@ class Upsert extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, + authorization: $authorization ); $relationships = \array_map( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php index 8b770284c3..ff94e67b02 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php @@ -74,20 +74,21 @@ class XList extends Action ->inject('dbForProject') ->inject('queueForStatsUsage') ->inject('transactionState') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, array $queries, ?string $transactionId, bool $includeTotal, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, TransactionState $transactionState): void + public function action(string $databaseId, string $collectionId, array $queries, ?string $transactionId, bool $includeTotal, UtopiaResponse $response, Database $dbForProject, StatsUsage $queueForStatsUsage, TransactionState $transactionState, Authorization $authorization): void { - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + $collection = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception($this->getParentNotFoundException(), params: [$collectionId]); } @@ -115,7 +116,7 @@ class XList extends Action $documentId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); if ($cursorDocument->isEmpty()) { $type = ucfirst($this->getContext()); @@ -161,7 +162,8 @@ class XList extends Action document: $document, dbForProject: $dbForProject, collectionsCache: $collectionsCache, - operations: $operations, + authorization: $authorization, + operations: $operations ); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php index e7909772a5..d8df8f1f8c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Get.php @@ -57,12 +57,13 @@ class Get extends Action ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $collectionId, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php index 872b7348fe..7995c19af7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Create.php @@ -79,12 +79,13 @@ class Create extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, array $lengths, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, array $lengths, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { - $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $db = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); @@ -198,7 +199,13 @@ class Create extends Action $dbForProject->getAdapter()->getSupportForVectors(), $dbForProject->getAdapter()->getSupportForAttributes(), $dbForProject->getAdapter()->getSupportForMultipleFulltextIndexes(), - $dbForProject->getAdapter()->getSupportForIdenticalIndexes() + $dbForProject->getAdapter()->getSupportForIdenticalIndexes(), + $dbForProject->getAdapter()->getSupportForObjectIndexes(), + $dbForProject->getAdapter()->getSupportForTrigramIndex(), + $dbForProject->getAdapter()->getSupportForSpatialAttributes(), + $dbForProject->getAdapter()->getSupportForIndex(), + $dbForProject->getAdapter()->getSupportForUniqueIndex(), + $dbForProject->getAdapter()->getSupportForFulltextIndex(), ); if (!$validator->isValid($index)) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php index 27b28e866c..d9f9f66504 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Delete.php @@ -70,12 +70,13 @@ class Delete extends Action ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, Authorization $authorization): void { - $db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $db = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($db->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php index d66bf8f38f..661f259910 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/Get.php @@ -59,12 +59,13 @@ class Get extends Action ->param('key', null, new Key(), 'Index Key.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $collectionId, string $key, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php index abbdefb4d5..90826ffbe3 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Indexes/XList.php @@ -66,13 +66,14 @@ class XList extends Action ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, array $queries, bool $includeTotal, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $collectionId, array $queries, bool $includeTotal, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { /** @var Document $database */ - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); @@ -112,7 +113,7 @@ class XList extends Action } $indexId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->find('indexes', [ + $cursorDocument = $authorization->skip(fn () => $dbForProject->find('indexes', [ Query::equal('collectionInternalId', [$collection->getSequence()]), Query::equal('databaseInternalId', [$database->getSequence()]), Query::equal('key', [$indexId]), diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php index 0f5a57c6e9..0b6e47a798 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Logs/XList.php @@ -71,13 +71,14 @@ class XList extends Action ->inject('dbForProject') ->inject('locale') ->inject('geodb') + ->inject('authorization') ->inject('audit') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb, Audit $audit): void + public function action(string $databaseId, string $collectionId, array $queries, UtopiaResponse $response, Database $dbForProject, Locale $locale, Reader $geodb, Authorization $authorization, Audit $audit): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); @@ -112,9 +113,9 @@ class XList extends Action $detector = new Detector($log['userAgent']); $detector->skipBotDetection(); // OPTIONAL: If called, bot detection will completely be skipped (bots will be detected as regular devices then) - $os = $detector->getOS(); - $client = $detector->getClient(); - $device = $detector->getDevice(); + $os = $detector->getOS() ?: []; + $client = $detector->getClient() ?: []; + $device = $detector->getDevice() ?: []; $output[$i] = new Document([ 'event' => $log['event'], @@ -122,20 +123,20 @@ class XList extends Action 'userEmail' => $log['data']['userEmail'] ?? null, 'userName' => $log['data']['userName'] ?? null, 'mode' => $log['data']['mode'] ?? null, - 'ip' => $log['ip'], - 'time' => $log['time'], - 'osCode' => $os['osCode'], - 'osName' => $os['osName'], - 'osVersion' => $os['osVersion'], - 'clientType' => $client['clientType'], - 'clientCode' => $client['clientCode'], - 'clientName' => $client['clientName'], - 'clientVersion' => $client['clientVersion'], - 'clientEngine' => $client['clientEngine'], - 'clientEngineVersion' => $client['clientEngineVersion'], - 'deviceName' => $device['deviceName'], - 'deviceBrand' => $device['deviceBrand'], - 'deviceModel' => $device['deviceModel'] + 'ip' => $log['ip'] ?? null, + 'time' => $log['time'] ?? null, + 'osCode' => $os['osCode'] ?? null, + 'osName' => $os['osName'] ?? null, + 'osVersion' => $os['osVersion'] ?? null, + 'clientType' => $client['clientType'] ?? null, + 'clientCode' => $client['clientCode'] ?? null, + 'clientName' => $client['clientName'] ?? null, + 'clientVersion' => $client['clientVersion'] ?? null, + 'clientEngine' => $client['clientEngine'] ?? null, + 'clientEngineVersion' => $client['clientEngineVersion'] ?? null, + 'deviceName' => $device['deviceName'] ?? null, + 'deviceBrand' => $device['deviceBrand'] ?? null, + 'deviceModel' => $device['deviceModel'] ?? null ]); $record = $geodb->get($log['ip']); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php index e319a33e67..304ce5c88e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php @@ -71,12 +71,13 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $databaseId, string $collectionId, string $name, ?array $permissions, bool $documentSecurity, bool $enabled, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php index c4a46650c9..0552a31509 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Usage/Get.php @@ -63,10 +63,11 @@ class Get extends Action ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $range, string $collectionId, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $range, string $collectionId, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { $database = $dbForProject->getDocument('databases', $databaseId); $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); @@ -83,7 +84,7 @@ class Get extends Action str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collectionDocument->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS), ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php index b0b0385bf5..c23286f3cd 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/XList.php @@ -67,12 +67,13 @@ class XList extends Action ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, array $queries, string $search, bool $includeTotal, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, array $queries, string $search, bool $includeTotal, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { - $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + $database = $authorization->skip(fn () => $dbForProject->getDocument('databases', $databaseId)); if ($database->isEmpty()) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$databaseId]); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Create.php index 20c71223c6..4ca20f8414 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Create.php @@ -55,10 +55,11 @@ class Create extends Action ->inject('response') ->inject('dbForProject') ->inject('user') + ->inject('authorization') ->callback($this->action(...)); } - public function action(int $ttl, UtopiaResponse $response, Database $dbForProject, Document $user): void + public function action(int $ttl, UtopiaResponse $response, Database $dbForProject, Document $user, Authorization $authorization): void { $permissions = []; if (!empty($user->getId())) { @@ -73,7 +74,7 @@ class Create extends Action } } - $transaction = Authorization::skip(fn () => $dbForProject->createDocument('transactions', new Document([ + $transaction = $authorization->skip(fn () => $dbForProject->createDocument('transactions', new Document([ '$id' => ID::unique(), '$permissions' => $permissions, 'status' => 'pending', diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Operations/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Operations/Create.php index 5a2568db0c..f09ed2bc27 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Operations/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Operations/Create.php @@ -18,6 +18,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Swoole\Response as SwooleResponse; use Utopia\Validator\ArrayList; @@ -63,21 +64,22 @@ class Create extends Action ->inject('dbForProject') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $transactionId, array $operations, UtopiaResponse $response, Database $dbForProject, TransactionState $transactionState, array $plan): void + public function action(string $transactionId, array $operations, UtopiaResponse $response, Database $dbForProject, TransactionState $transactionState, array $plan, Authorization $authorization): void { if (empty($operations)) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Operations array cannot be empty'); } - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); // API keys and admins can read any transaction, regular users need permissions $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -113,13 +115,13 @@ class Create extends Action throw new Exception(Exception::USER_UNAUTHORIZED); } - $database = $databases[$operation['databaseId']] ??= Authorization::skip(fn () => $dbForProject->getDocument('databases', $operation['databaseId'])); + $database = $databases[$operation['databaseId']] ??= $authorization->skip(fn () => $dbForProject->getDocument('databases', $operation['databaseId'])); if ($database->isEmpty() || (!$database->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::DATABASE_NOT_FOUND, params: [$operation['databaseId']]); } $collection = $collections[$operation[$this->getGroupId()]] ??= - Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $operation[$this->getGroupId()])); + $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $operation[$this->getGroupId()])); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND, params: [$operation[$this->getGroupId()]]); @@ -165,14 +167,20 @@ class Create extends Action // For individual operations, enforce permissions unless using API key/admin if (!$isAPIKey && !$isPrivilegedUser) { $documentSecurity = $collection->getAttribute('documentSecurity', false); - $validator = new Authorization($permissionType); - $collectionValid = $validator->isValid($collection->getPermissionsByType($permissionType)); + + $collectionValid = $authorization->isValid( + new Input($permissionType, $collection->getPermissionsByType($permissionType)) + ); $documentValid = false; if ($document !== null && !$document->isEmpty() && $documentSecurity) { if ($permissionType === Database::PERMISSION_UPDATE) { - $documentValid = $validator->isValid($document->getUpdate()); + $documentValid = $authorization->isValid( + new Input(Database::PERMISSION_UPDATE, $document->getUpdate()) + ); } elseif ($permissionType === Database::PERMISSION_DELETE) { - $documentValid = $validator->isValid($document->getDelete()); + $documentValid = $authorization->isValid( + new Input(Database::PERMISSION_DELETE, $document->getDelete()) + ); } } @@ -189,7 +197,7 @@ class Create extends Action // Users can only set permissions for roles they have if (isset($operation['data']['$permissions'])) { $permissions = $operation['data']['$permissions']; - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); foreach (Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { $permission = Permission::parse($permission); @@ -201,7 +209,7 @@ class Create extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { + if (!$authorization->hasRole($role)) { throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); } } @@ -230,7 +238,7 @@ class Create extends Action } } - $transaction = Authorization::skip(fn () => $dbForProject->withTransaction(function () use ($dbForProject, $transactionId, $staged, $existing, $operations) { + $transaction = $authorization->skip(fn () => $dbForProject->withTransaction(function () use ($dbForProject, $transactionId, $staged, $existing, $operations) { $dbForProject->createDocuments('transactionLogs', $staged); return $dbForProject->increaseDocumentAttribute( 'transactions', diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php index 9235c81b8e..e4f1051464 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php @@ -76,6 +76,7 @@ class Update extends Action ->inject('queueForRealtime') ->inject('queueForFunctions') ->inject('queueForWebhooks') + ->inject('authorization') ->callback($this->action(...)); } @@ -102,7 +103,7 @@ class Update extends Action * @throws Structure * @throws \Utopia\Exception */ - public function action(string $transactionId, bool $commit, bool $rollback, UtopiaResponse $response, Database $dbForProject, Document $user, TransactionState $transactionState, Delete $queueForDeletes, Event $queueForEvents, StatsUsage $queueForStatsUsage, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks): void + public function action(string $transactionId, bool $commit, bool $rollback, UtopiaResponse $response, Database $dbForProject, Document $user, TransactionState $transactionState, Delete $queueForDeletes, Event $queueForEvents, StatsUsage $queueForStatsUsage, Event $queueForRealtime, Event $queueForFunctions, Event $queueForWebhooks, Authorization $authorization): void { if (!$commit && !$rollback) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Either commit or rollback must be true'); @@ -111,11 +112,11 @@ class Update extends Action throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Cannot commit and rollback at the same time'); } - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); $transaction = ($isAPIKey || $isPrivilegedUser) - ? Authorization::skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) + ? $authorization->skip(fn () => $dbForProject->getDocument('transactions', $transactionId)) : $dbForProject->getDocument('transactions', $transactionId); if ($transaction->isEmpty()) { throw new Exception(Exception::TRANSACTION_NOT_FOUND, params: [$transactionId]); @@ -138,12 +139,12 @@ class Update extends Action $currentDocumentId = null; try { - $dbForProject->withTransaction(function () use ($dbForProject, $transactionState, $queueForDeletes, $transactionId, &$transaction, &$operations, &$totalOperations, &$databaseOperations, &$currentDocumentId, $queueForEvents, $queueForStatsUsage, $queueForRealtime, $queueForFunctions, $queueForWebhooks) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $dbForProject->withTransaction(function () use ($dbForProject, $transactionState, $queueForDeletes, $transactionId, &$transaction, &$operations, &$totalOperations, &$databaseOperations, &$currentDocumentId, $queueForEvents, $queueForStatsUsage, $queueForRealtime, $queueForFunctions, $queueForWebhooks, $authorization) { + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'committing', ]))); - $operations = Authorization::skip(fn () => $dbForProject->find('transactionLogs', [ + $operations = $authorization->skip(fn () => $dbForProject->find('transactionLogs', [ Query::equal('transactionInternalId', [$transaction->getSequence()]), Query::orderAsc(), Query::limit(PHP_INT_MAX), @@ -167,7 +168,7 @@ class Update extends Action } if (!isset($collections[$collectionId])) { - $collections[$collectionId] = Authorization::skip( + $collections[$collectionId] = $authorization->skip( fn () => $dbForProject->getCollection($collectionId) ); } @@ -232,7 +233,7 @@ class Update extends Action } } - $transaction = Authorization::skip(fn () => $dbForProject->updateDocument( + $transaction = $authorization->skip(fn () => $dbForProject->updateDocument( 'transactions', $transactionId, new Document(['status' => 'committed']) @@ -243,33 +244,33 @@ class Update extends Action ->setDocument($transaction); }); } catch (NotFoundException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::DOCUMENT_NOT_FOUND, previous: $e, params: [$currentDocumentId ?? 'unknown']); } catch (DuplicateException | ConflictException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::TRANSACTION_CONFLICT, previous: $e); } catch (StructureException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); } catch (LimitException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, $e->getMessage()); } catch (TransactionException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::TRANSACTION_FAILED, $e->getMessage()); } catch (QueryException $e) { - Authorization::skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ + $authorization->skip(fn () => $dbForProject->updateDocument('transactions', $transactionId, new Document([ 'status' => 'failed', ]))); throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); @@ -297,11 +298,11 @@ class Update extends Action $data = $data->getArrayCopy(); } - $database = Authorization::skip(fn () => $dbForProject->findOne('databases', [ + $database = $authorization->skip(fn () => $dbForProject->findOne('databases', [ Query::equal('$sequence', [$databaseInternalId]) ])); - $collection = Authorization::skip(fn () => $dbForProject->findOne('database_' . $databaseInternalId, [ + $collection = $authorization->skip(fn () => $dbForProject->findOne('database_' . $databaseInternalId, [ Query::equal('$sequence', [$collectionInternalId]) ])); @@ -393,7 +394,7 @@ class Update extends Action } if ($rollback) { - $transaction = Authorization::skip(fn () => $dbForProject->updateDocument( + $transaction = $authorization->skip(fn () => $dbForProject->updateDocument( 'transactions', $transactionId, new Document(['status' => 'failed']) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php index a717b00ae4..a1aa7a70b8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php @@ -59,10 +59,11 @@ class Get extends Action ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $databaseId, string $range, UtopiaResponse $response, Database $dbForProject): void + public function action(string $databaseId, string $range, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { $database = $dbForProject->getDocument('databases', $databaseId); @@ -81,7 +82,7 @@ class Get extends Action str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES) ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php index c13149cfc7..757f845c68 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php @@ -56,10 +56,11 @@ class XList extends Action ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $range, UtopiaResponse $response, Database $dbForProject): void + public function action(string $range, UtopiaResponse $response, Database $dbForProject, Authorization $authorization): void { $periods = Config::getParam('usage', []); @@ -74,7 +75,7 @@ class XList extends Action METRIC_DATABASES_OPERATIONS_WRITES, ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php index c0d502d10a..eede1b221b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Create.php @@ -60,6 +60,7 @@ class Create extends BooleanCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php index c5939b6974..cd8d392cfc 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Boolean/Update.php @@ -61,6 +61,7 @@ class Update extends BooleanUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php index 63693abb67..79722efee1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Create.php @@ -62,6 +62,7 @@ class Create extends DatetimeCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php index b022d0ed85..c39681a743 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Datetime/Update.php @@ -63,6 +63,7 @@ class Update extends DatetimeUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php index 8a691a6e98..da63b0cef7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Delete.php @@ -58,6 +58,7 @@ class Delete extends AttributesDelete ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php index 6d19f99b7b..51e7f295a1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Create.php @@ -61,6 +61,7 @@ class Create extends EmailCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php index 48a04304bd..daca13d587 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Email/Update.php @@ -62,6 +62,7 @@ class Update extends EmailUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php index bd280a2910..4d5881c81e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Create.php @@ -64,6 +64,7 @@ class Create extends EnumCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php index ac5c1cf907..122671adc5 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Enum/Update.php @@ -65,6 +65,7 @@ class Update extends EnumUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php index 8293d66992..cd898fa0bf 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Create.php @@ -63,6 +63,7 @@ class Create extends FloatCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php index bf2815db45..ee9c5f6cb1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Float/Update.php @@ -64,6 +64,7 @@ class Update extends FloatUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php index ee88ac8683..39dafbd1a6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Get.php @@ -61,6 +61,7 @@ class Get extends AttributesGet ->param('key', '', new Key(), 'Column Key.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php index 9b38cd9dfd..80c764b4c5 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Create.php @@ -61,6 +61,7 @@ class Create extends IPCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php index 7db8625ebf..54ed029c71 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/IP/Update.php @@ -62,6 +62,7 @@ class Update extends IPUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php index e0ed059681..f590e8bdbb 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Create.php @@ -55,14 +55,15 @@ class Create extends IntegerCreate ->param('tableId', '', new UID(), 'Table ID.') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('min', null, new Nullable(new Integer()), 'Minimum value', true) - ->param('max', null, new Nullable(new Integer()), 'Maximum value', true) - ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when column is required.', true) + ->param('min', null, new Nullable(new Integer(false, 64)), 'Minimum value', true) + ->param('max', null, new Nullable(new Integer(false, 64)), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer(false, 64)), 'Default value. Cannot be set when column is required.', true) ->param('array', false, new Boolean(), 'Is column an array?', true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php index 7afc239201..83b6f1bfc6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php @@ -57,13 +57,14 @@ class Update extends IntegerUpdate ->param('tableId', '', new UID(), 'Table ID.') ->param('key', '', new Key(), 'Column Key.') ->param('required', null, new Boolean(), 'Is column required?') - ->param('min', null, new Nullable(new Integer()), 'Minimum value', true) - ->param('max', null, new Nullable(new Integer()), 'Maximum value', true) - ->param('default', null, new Nullable(new Integer()), 'Default value. Cannot be set when column is required.') + ->param('min', null, new Nullable(new Integer(false, 64)), 'Minimum value', true) + ->param('max', null, new Nullable(new Integer(false, 64)), 'Maximum value', true) + ->param('default', null, new Nullable(new Integer(false, 64)), 'Default value. Cannot be set when column is required.') ->param('newKey', null, new Nullable(new Key()), 'New Column Key.', true) ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php index 6110d6ee07..227fece7de 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Create.php @@ -61,6 +61,7 @@ class Create extends LineCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php index afd0098152..b0e433da5f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Line/Update.php @@ -63,6 +63,7 @@ class Update extends LineUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php index 084adca860..3fc5865905 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Create.php @@ -61,6 +61,7 @@ class Create extends PointCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php index 632be85871..040b8171d7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Point/Update.php @@ -63,6 +63,7 @@ class Update extends PointUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php index 723940af58..630340ba7b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Create.php @@ -61,6 +61,7 @@ class Create extends PolygonCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php index 91b55f74b4..43b4a4e6a4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Polygon/Update.php @@ -63,6 +63,7 @@ class Update extends PolygonUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php index f3933160c0..7f28a3cdb7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Create.php @@ -73,6 +73,7 @@ class Create extends RelationshipCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php index eb87713457..fd7fdab8de 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Relationship/Update.php @@ -65,6 +65,7 @@ class Update extends RelationshipUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php index 9279409e88..ff50313a7c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Create.php @@ -66,6 +66,7 @@ class Create extends StringCreate ->inject('queueForDatabase') ->inject('queueForEvents') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php index 9fffa71b33..6ad1be124b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/String/Update.php @@ -65,6 +65,7 @@ class Update extends StringUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php index 50f5ea5d5b..b19d6e80a2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Create.php @@ -61,6 +61,7 @@ class Create extends URLCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php index b52ea66ce1..dce11964e8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/URL/Update.php @@ -62,6 +62,7 @@ class Update extends URLUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php index 39551e5113..13ebe14682 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/XList.php @@ -52,6 +52,7 @@ class XList extends AttributesXList ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php index 7287c2cb3e..bd08ad5617 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Create.php @@ -67,6 +67,7 @@ class Create extends CollectionCreate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php index d4af8b3508..925a7b2494 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Delete.php @@ -55,6 +55,7 @@ class Delete extends CollectionDelete ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php index 4286ee07ca..ad83291815 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Get.php @@ -50,6 +50,7 @@ class Get extends CollectionGet ->param('tableId', '', new UID(), 'Table ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php index 727334b6da..09720f4d71 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Create.php @@ -66,6 +66,8 @@ class Create extends IndexCreate ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } + } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php index 7d187ab5a1..7fa8073d1e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Delete.php @@ -61,6 +61,7 @@ class Delete extends IndexDelete ->inject('dbForProject') ->inject('queueForDatabase') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php index 75ee507aa8..246d569825 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/Get.php @@ -52,6 +52,7 @@ class Get extends IndexGet ->param('key', null, new Key(), 'Index Key.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php index bf5f27e388..1dc2d3ea43 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Indexes/XList.php @@ -54,6 +54,7 @@ class XList extends IndexXList ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php index 5eab050b7e..79691436e4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Logs/XList.php @@ -50,6 +50,7 @@ class XList extends CollectionLogXList ->inject('dbForProject') ->inject('locale') ->inject('geodb') + ->inject('authorization') ->inject('audit') ->callback($this->action(...)); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php index accb0392fe..b9896d282d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Delete.php @@ -66,6 +66,7 @@ class Delete extends DocumentsDelete ->inject('queueForFunctions') ->inject('queueForWebhooks') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php index fea59b8b13..f4ccea1698 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php @@ -68,6 +68,7 @@ class Update extends DocumentsUpdate ->inject('queueForFunctions') ->inject('queueForWebhooks') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php index 492af25e9f..69a687d92f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Upsert.php @@ -68,6 +68,7 @@ class Upsert extends DocumentsUpsert ->inject('queueForFunctions') ->inject('queueForWebhooks') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php index 42f2919ce1..a660b008e1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Decrement.php @@ -67,6 +67,7 @@ class Decrement extends DecrementDocumentAttribute ->inject('queueForEvents') ->inject('queueForStatsUsage') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php index 3d04d71c26..c2b69429ce 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Column/Increment.php @@ -67,6 +67,7 @@ class Increment extends IncrementDocumentAttribute ->inject('queueForEvents') ->inject('queueForStatsUsage') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php index b5491a593b..c70ed71378 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Create.php @@ -111,6 +111,7 @@ class Create extends DocumentCreate ->inject('queueForFunctions') ->inject('queueForWebhooks') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php index bcd8682a48..1763491c19 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Delete.php @@ -70,6 +70,7 @@ class Delete extends DocumentDelete ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php index 450fb4d746..bb24e93de0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Get.php @@ -58,6 +58,7 @@ class Get extends DocumentGet ->inject('dbForProject') ->inject('queueForStatsUsage') ->inject('transactionState') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php index 27bd82195d..86bfcfec85 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Logs/XList.php @@ -51,6 +51,7 @@ class XList extends DocumentLogXList ->inject('dbForProject') ->inject('locale') ->inject('geodb') + ->inject('authorization') ->inject('audit') ->callback($this->action(...)); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php index fe4ffc4995..0879055a78 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php @@ -69,6 +69,7 @@ class Update extends DocumentUpdate ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php index 0fbaa921cb..99e0487c93 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php @@ -72,6 +72,7 @@ class Upsert extends DocumentUpsert ->inject('queueForStatsUsage') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php index c51017fa75..230d391110 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/XList.php @@ -59,6 +59,7 @@ class XList extends DocumentXList ->inject('dbForProject') ->inject('queueForStatsUsage') ->inject('transactionState') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php index 03316783cd..0d3bc9afc1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php @@ -62,6 +62,7 @@ class Update extends CollectionUpdate ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php index 0fb44ee94a..b8be7edd56 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Usage/Get.php @@ -52,6 +52,7 @@ class Get extends CollectionUsageGet ->param('tableId', '', new UID(), 'Table ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php index e0c590379b..5532203d0a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/XList.php @@ -55,6 +55,7 @@ class XList extends CollectionXList ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Create.php index 27454664f4..e7e5f0132f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Create.php @@ -50,6 +50,7 @@ class Create extends TransactionsCreate ->inject('response') ->inject('dbForProject') ->inject('user') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Operations/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Operations/Create.php index 4668ae2d15..1228c83e30 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Operations/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Operations/Create.php @@ -54,6 +54,7 @@ class Create extends OperationsCreate ->inject('dbForProject') ->inject('transactionState') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Update.php index 4337a8d28d..8be28ce9f7 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/Update.php @@ -60,6 +60,7 @@ class Update extends TransactionsUpdate ->inject('queueForRealtime') ->inject('queueForFunctions') ->inject('queueForWebhooks') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php index 89b9fbd8c2..87be8a9eab 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/Get.php @@ -48,6 +48,7 @@ class Get extends DatabaseUsageGet ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php index 0bd96fc40a..2cde337f5f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Usage/XList.php @@ -46,6 +46,7 @@ class XList extends DatabaseUsageXList ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index e7e34d4c5b..c5ae08728d 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -17,6 +17,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -88,6 +89,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -105,7 +107,8 @@ class Create extends Action Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds, - array $plan + array $plan, + Authorization $authorization ) { $activate = \strval($activate) === 'true' || \strval($activate) === '1'; diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php index 0aaea3bd4a..acfaa965ac 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php @@ -15,6 +15,7 @@ use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -77,6 +78,7 @@ class Create extends Base ->inject('project') ->inject('queueForBuilds') ->inject('gitHub') + ->inject('authorization') ->callback($this->action(...)); } @@ -95,7 +97,8 @@ class Create extends Base Event $queueForEvents, Document $project, Build $queueForBuilds, - GitHub $github + GitHub $github, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -127,7 +130,9 @@ class Create extends Base queueForBuilds: $queueForBuilds, template: $template, github: $github, - activate: $activate + activate: $activate, + referenceType: $type, + reference: $reference ); $queueForEvents @@ -170,6 +175,9 @@ class Create extends Base ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); + + $this->updateEmptyManualRule($project, $function, $deployment, $dbForPlatform, $authorization); + $queueForBuilds ->setType(BUILD_TYPE_DEPLOYMENT) ->setResource($function) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php index 69594c3d86..25dce63b38 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php @@ -87,7 +87,7 @@ class Create extends Base Document $project, Event $queueForEvents, Build $queueForBuilds, - GitHub $github + GitHub $github, ) { $function = $dbForProject->getDocument('functions', $functionId); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php index 81f55ba829..1a265298d3 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php @@ -29,6 +29,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -99,6 +100,7 @@ class Create extends Base ->inject('proofForToken') ->inject('executor') ->inject('platform') + ->inject('authorization') ->callback($this->action(...)); } @@ -123,7 +125,8 @@ class Create extends Base Store $store, Token $proofForToken, Executor $executor, - array $platform + array $platform, + Authorization $authorization, ) { $async = \strval($async) === 'true' || \strval($async) === '1'; @@ -161,10 +164,10 @@ class Create extends Base throw new Exception($validator->getDescription(), 400); } - $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId)); + $function = $authorization->skip(fn () => $dbForProject->getDocument('functions', $functionId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($function->isEmpty() || (!$function->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::FUNCTION_NOT_FOUND); @@ -180,7 +183,7 @@ class Create extends Base throw new Exception(Exception::FUNCTION_RUNTIME_UNSUPPORTED, 'Runtime "' . $function->getAttribute('runtime', '') . '" is not supported'); } - $deployment = Authorization::skip(fn () => $dbForProject->getDocument('deployments', $function->getAttribute('deploymentId', ''))); + $deployment = $authorization->skip(fn () => $dbForProject->getDocument('deployments', $function->getAttribute('deploymentId', ''))); if ($deployment->getAttribute('resourceId') !== $function->getId()) { throw new Exception(Exception::DEPLOYMENT_NOT_FOUND, 'Deployment not found. Create a deployment before trying to execute a function'); @@ -194,10 +197,8 @@ class Create extends Base throw new Exception(Exception::BUILD_NOT_READY); } - $validator = new Authorization('execute'); - - if (!$validator->isValid($function->getAttribute('execute'))) { // Check if user has write access to execute function - throw new Exception(Exception::USER_UNAUTHORIZED, $validator->getDescription()); + if (!$authorization->isValid(new Input('execute', $function->getAttribute('execute')))) { // Check if user has write access to execute function + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } $jwt = ''; // initialize @@ -295,7 +296,7 @@ class Create extends Base if ($async) { if (is_null($scheduledAt)) { - $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); + $execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution)); $queueForFunctions ->setType('http') ->setExecution($execution) @@ -336,7 +337,7 @@ class Create extends Base ->setAttribute('scheduleInternalId', $schedule->getSequence()) ->setAttribute('scheduledAt', $scheduledAt); - $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); + $execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution)); } return $response @@ -488,7 +489,7 @@ class Create extends Base ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ; - $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); + $execution = $authorization->skip(fn () => $dbForProject->createDocument('executions', $execution)); } $executionResponse['headers']['x-appwrite-execution-id'] = $execution->getId(); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php index 9a93e5a342..c7a9a6d330 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php @@ -61,6 +61,7 @@ class Delete extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -70,7 +71,8 @@ class Delete extends Base Response $response, Database $dbForProject, Database $dbForPlatform, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -108,7 +110,7 @@ class Delete extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('active', false); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); } } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php index 6bd0a3675e..c5eebe139e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php @@ -52,6 +52,7 @@ class Get extends Base ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } @@ -59,12 +60,13 @@ class Get extends Base string $functionId, string $executionId, Response $response, - Database $dbForProject + Database $dbForProject, + Authorization $authorization ) { - $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId)); + $function = $authorization->skip(fn () => $dbForProject->getDocument('functions', $functionId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($function->isEmpty() || (!$function->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::FUNCTION_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php index 20680e87ff..ff381e1f3d 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php @@ -60,6 +60,7 @@ class XList extends Base ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } @@ -68,12 +69,13 @@ class XList extends Base array $queries, bool $includeTotal, Response $response, - Database $dbForProject + Database $dbForProject, + Authorization $authorization ) { - $function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId)); + $function = $authorization->skip(fn () => $dbForProject->getDocument('functions', $functionId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($function->isEmpty() || (!$function->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::FUNCTION_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index 5c226c5925..6ad488283e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -115,6 +115,7 @@ class Create extends Base ->inject('dbForPlatform') ->inject('request') ->inject('gitHub') + ->inject('authorization') ->callback($this->action(...)); } @@ -152,7 +153,8 @@ class Create extends Base Func $queueForFunctions, Database $dbForPlatform, Request $request, - GitHub $github + GitHub $github, + Authorization $authorization ) { // Temporary abuse check @@ -237,7 +239,7 @@ class Create extends Base throw new Exception(Exception::FUNCTION_ALREADY_EXISTS); } - $schedule = Authorization::skip( + $schedule = $authorization->skip( fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), 'resourceType' => SCHEDULE_RESOURCE_TYPE_FUNCTION, @@ -315,6 +317,7 @@ class Create extends Base template: $template, github: $github, activate: true, + authorization: $authorization, reference: $providerBranch, referenceType: 'branch' ); @@ -366,7 +369,7 @@ class Create extends Base $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; $ruleId = $isMd5 ? md5($domain) : ID::unique(); - $rule = Authorization::skip( + $rule = $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php index dfa6636554..9cafc17bbe 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php @@ -61,6 +61,7 @@ class Delete extends Base ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('dbForPlatform') + ->inject('authorization') ->callback($this->action(...)); } @@ -70,7 +71,8 @@ class Delete extends Base Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, - Database $dbForPlatform + Database $dbForPlatform, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -87,7 +89,7 @@ class Delete extends Base $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('active', false); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php index b6dcfd6cf8..aeccf98a02 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php @@ -62,6 +62,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') + ->inject('authorization') ->callback($this->action(...)); } @@ -72,7 +73,8 @@ class Update extends Base Response $response, Database $dbForProject, Event $queueForEvents, - Database $dbForPlatform + Database $dbForPlatform, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); $deployment = $dbForProject->getDocument('deployments', $deploymentId); @@ -101,7 +103,7 @@ class Update extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queries = [ Query::equal('trigger', ['manual']), @@ -112,12 +114,12 @@ class Update extends Base Query::equal('projectInternalId', [$project->getSequence()]) ]; - Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $authorization->skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment, $authorization) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) ->setAttribute('deploymentInternalId', $deployment->getSequence()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); }, $queries)); $queueForEvents diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index adb29bc533..55c5b30418 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -104,6 +104,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') + ->inject('authorization') ->callback($this->action(...)); } @@ -134,7 +135,8 @@ class Update extends Base Build $queueForBuilds, Database $dbForPlatform, GitHub $github, - Executor $executor + Executor $executor, + Authorization $authorization ) { // TODO: If only branch changes, re-deploy $function = $dbForProject->getDocument('functions', $functionId); @@ -282,7 +284,7 @@ class Update extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queueForEvents->setParam('functionId', $function->getId()); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php index acb6995d6f..1fa65d0cc9 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php @@ -55,10 +55,11 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $functionId, string $range, Response $response, Database $dbForProject) + public function action(string $functionId, string $range, Response $response, Database $dbForProject, Authorization $authorization) { $function = $dbForProject->getDocument('functions', $functionId); @@ -83,7 +84,7 @@ class Get extends Base str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php index 6a4ded4db7..38a95d4469 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php @@ -52,10 +52,11 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $range, Response $response, Database $dbForProject) + public function action(string $range, Response $response, Database $dbForProject, Authorization $authorization) { $periods = Config::getParam('usage', []); $stats = $usage = []; @@ -75,7 +76,7 @@ class XList extends Base str_replace("{resourceType}", RESOURCE_TYPE_FUNCTIONS, METRIC_RESOURCE_TYPE_BUILDS_FAILED), ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php index 815f1bd8fc..5438479d40 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php @@ -65,6 +65,7 @@ class Create extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('project') + ->inject('authorization') ->callback($this->action(...)); } @@ -76,7 +77,8 @@ class Create extends Base Response $response, Database $dbForProject, Database $dbForPlatform, - Document $project + Document $project, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -119,7 +121,7 @@ class Create extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response ->setStatusCode(Response::STATUS_CODE_CREATED) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php index 50c1de4232..161eed3112 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php @@ -57,6 +57,7 @@ class Delete extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') + ->inject('authorization') ->callback($this->action(...)); } @@ -65,7 +66,8 @@ class Delete extends Base string $variableId, Response $response, Database $dbForProject, - Database $dbForPlatform + Database $dbForPlatform, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -92,7 +94,7 @@ class Delete extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response->noContent(); } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php index 5c1f5809cd..6af5ac90c2 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php @@ -62,6 +62,7 @@ class Update extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') + ->inject('authorization') ->callback($this->action(...)); } @@ -73,7 +74,8 @@ class Update extends Base ?bool $secret, Response $response, Database $dbForProject, - Database $dbForPlatform + Database $dbForPlatform, + Authorization $authorization ) { $function = $dbForProject->getDocument('functions', $functionId); @@ -110,7 +112,7 @@ class Update extends Base ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response->dynamic($variable, Response::MODEL_VARIABLE); } diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 285f78319a..8f041dd57b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -25,7 +25,6 @@ use Utopia\Database\Exception\Duplicate; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\Detector\Detection\Rendering\SSR; use Utopia\Detector\Detection\Rendering\XStatic; use Utopia\Detector\Detector\Rendering; @@ -1024,6 +1023,11 @@ class Builds extends Action Console::log('Deployment activated'); } + $this->afterDeploymentSuccess( + $project, + $deployment, + ); + // Send realtime event after updating the associated resource so that Console will have the resource's deployment details when re-fetching. $queueForRealtime ->setPayload($deployment->getArrayCopy()) @@ -1116,7 +1120,7 @@ class Builds extends Action ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $resource->getAttribute('schedule')) ->setAttribute('active', !empty($resource->getAttribute('schedule')) && !empty($resource->getAttribute('deploymentId'))); - Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); + $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule); } Console::info('Deployment action finished'); @@ -1256,6 +1260,26 @@ class Builds extends Action } } + /** + * Hook to run after deployment is activated + * + * @param Document $project + * @param Document $deployment + * @return void + */ + protected function afterDeploymentSuccess( + Document $project, + Document $deployment, + ): void { + if (!($project instanceof Document)) { + throw new Exception('project must be an instance of Document'); + } + + if (!($deployment instanceof Document)) { + throw new Exception('deployment must be an instance of Document'); + } + } + protected function getRuntime(Document $resource, string $version): array { $runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []); @@ -1325,7 +1349,6 @@ class Builds extends Action * @return void * @throws Structure * @throws \Utopia\Database\Exception - * @throws Authorization * @throws Conflict * @throws Restricted */ @@ -1414,11 +1437,11 @@ class Builds extends Action default => throw new \Exception('Invalid resource type') }; - $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ + $rule = $dbForPlatform->findOne('rules', [ Query::equal("projectInternalId", [$project->getSequence()]), Query::equal("type", ["deployment"]), Query::equal("deploymentInternalId", [$deployment->getSequence()]), - ])); + ]); $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; $previewUrl = match($resource->getCollection()) { diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/DB/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/DB/Get.php index 28cf00c8cd..f24de7eeca 100644 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/DB/Get.php +++ b/src/Appwrite/Platform/Modules/Health/Http/Health/DB/Get.php @@ -11,6 +11,7 @@ use Appwrite\Utopia\Response; use Utopia\Config\Config; use Utopia\Database\Adapter\Pool as DatabasePool; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Pools\Group; @@ -48,10 +49,11 @@ class Get extends Action )) ->inject('response') ->inject('pools') + ->inject('authorization') ->callback($this->action(...)); } - public function action(Response $response, Group $pools): void + public function action(Response $response, Group $pools, Authorization $authorization): void { $output = []; $failures = []; @@ -65,6 +67,7 @@ class Get extends Action foreach ($config as $database) { try { $adapter = new DatabasePool($pools->get($database)); + $adapter->setAuthorization($authorization); $checkStart = \microtime(true); @@ -83,6 +86,8 @@ class Get extends Action } } + // Only throw error if ALL databases failed (no successful pings) + // This allows partial failures in environments where not all DBs are ready if (!empty($failures)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'DB failure on: ' . implode(", ", $failures)); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index 4ba51bca37..3de0322d6e 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -87,6 +87,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -106,7 +107,8 @@ class Create extends Action Device $deviceForSites, Device $deviceForLocal, Build $queueForBuilds, - array $plan + array $plan, + Authorization $authorization ) { $activate = \strval($activate) === 'true' || \strval($activate) === '1'; @@ -276,7 +278,7 @@ class Create extends Action $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; $ruleId = $isMd5 ? md5($domain) : ID::unique(); - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -341,7 +343,7 @@ class Create extends Action $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); $domain = ID::unique() . "." . $sitesDomain; $ruleId = md5($domain); - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -366,6 +368,8 @@ class Create extends Action } } + + $metadata = null; $queueForEvents diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index 2f9b1bdfde..9554e2aa14 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -65,6 +65,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('deviceForSites') + ->inject('authorization') ->callback($this->action(...)); } @@ -78,7 +79,8 @@ class Create extends Action Database $dbForPlatform, Event $queueForEvents, Build $queueForBuilds, - Device $deviceForSites + Device $deviceForSites, + Authorization $authorization ) { $site = $dbForProject->getDocument('sites', $siteId); @@ -147,7 +149,7 @@ class Create extends Action $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; $ruleId = $isMd5 ? md5($domain) : ID::unique(); - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php index 5f1d446809..30d5e779c1 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php @@ -79,6 +79,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') + ->inject('authorization') ->callback($this->action(...)); } @@ -97,7 +98,8 @@ class Create extends Base Document $project, Event $queueForEvents, Build $queueForBuilds, - GitHub $github + GitHub $github, + Authorization $authorization ) { $site = $dbForProject->getDocument('sites', $siteId); @@ -130,6 +132,7 @@ class Create extends Base template: $template, github: $github, activate: $activate, + authorization: $authorization, ); $queueForEvents @@ -189,7 +192,7 @@ class Create extends Base $isMd5 = System::getEnv('_APP_RULES_FORMAT') === 'md5'; $ruleId = $isMd5 ? md5($domain) : ID::unique(); - Authorization::skip( + $authorization->skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -209,6 +212,8 @@ class Create extends Base ])) ); + $this->updateEmptyManualRule($project, $site, $deployment, $dbForPlatform, $authorization); + $queueForBuilds ->setType(BUILD_TYPE_DEPLOYMENT) ->setResource($site) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php index 915e3c5c9f..feff28427e 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php @@ -12,6 +12,7 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -72,6 +73,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') + ->inject('authorization') ->callback($this->action(...)); } @@ -87,7 +89,8 @@ class Create extends Base Document $project, Event $queueForEvents, Build $queueForBuilds, - GitHub $github + GitHub $github, + Authorization $authorization ) { $site = $dbForProject->getDocument('sites', $siteId); @@ -110,6 +113,7 @@ class Create extends Base template: $template, github: $github, activate: $activate, + authorization: $authorization, reference: $reference, referenceType: $type ); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php index f962d0118d..b5d956128b 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php @@ -60,6 +60,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') + ->inject('authorization') ->callback($this->action(...)); } @@ -70,7 +71,8 @@ class Update extends Base Response $response, Database $dbForProject, Event $queueForEvents, - Database $dbForPlatform + Database $dbForPlatform, + Authorization $authorization ) { $site = $dbForProject->getDocument('sites', $siteId); $deployment = $dbForProject->getDocument('deployments', $deploymentId); @@ -104,12 +106,12 @@ class Update extends Base Query::equal('projectInternalId', [$project->getSequence()]) ]; - Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $authorization->skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment, $authorization) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) ->setAttribute('deploymentInternalId', $deployment->getSequence()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + $authorization->skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); }, $queries)); $queueForEvents diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php index af96c10457..5c274d6a20 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php @@ -55,6 +55,7 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } @@ -62,7 +63,8 @@ class Get extends Base string $siteId, string $range, Response $response, - Database $dbForProject + Database $dbForProject, + Authorization $authorization ) { $site = $dbForProject->getDocument('sites', $siteId); @@ -91,7 +93,7 @@ class Get extends Base ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php index d36cc56ae5..a90cb0cab9 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php @@ -52,10 +52,11 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $range, Response $response, Database $dbForProject) + public function action(string $range, Response $response, Database $dbForProject, Authorization $authorization) { $periods = Config::getParam('usage', []); $stats = $usage = []; @@ -78,7 +79,7 @@ class XList extends Base METRIC_SITES_OUTBOUND, ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php index ed5c23b6c1..4757461a98 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php @@ -22,6 +22,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -90,6 +91,7 @@ class Create extends Action ->inject('mode') ->inject('deviceForFiles') ->inject('deviceForLocal') + ->inject('authorization') ->callback($this->action(...)); } @@ -105,26 +107,26 @@ class Create extends Action Event $queueForEvents, string $mode, Device $deviceForFiles, - Device $deviceForLocal + Device $deviceForLocal, + Authorization $authorization ) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $validator = new Authorization(\Utopia\Database\Database::PERMISSION_CREATE); - if (!$validator->isValid($bucket->getCreate())) { - throw new Exception(Exception::USER_UNAUTHORIZED); + if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } $allowedPermissions = [ - \Utopia\Database\Database::PERMISSION_READ, - \Utopia\Database\Database::PERMISSION_UPDATE, - \Utopia\Database\Database::PERMISSION_DELETE, + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, ]; // Map aggregate permissions to into the set of individual permissions they represent. @@ -141,7 +143,7 @@ class Create extends Action } // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); if (!$isAPIKey && !$isPrivilegedUser) { foreach (\Utopia\Database\Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { @@ -154,7 +156,7 @@ class Create extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { + if (!$authorization->hasRole($role)) { throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); } } @@ -379,11 +381,10 @@ class Create extends Action * However as with chunk upload even if we are updating, we are essentially creating a file * adding it's new chunk so we validate create permission instead of update */ - $validator = new Authorization(\Utopia\Database\Database::PERMISSION_CREATE); - if (!$validator->isValid($bucket->getCreate())) { + if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); + $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } // Trigger after create success hook @@ -427,13 +428,12 @@ class Create extends Action * However as with chunk upload even if we are updating, we are essentially creating a file * adding it's new chunk so we validate create permission instead of update */ - $validator = new Authorization(\Utopia\Database\Database::PERMISSION_CREATE); - if (!$validator->isValid($bucket->getCreate())) { + if (!$authorization->isValid(new Input(Database::PERMISSION_CREATE, $bucket->getCreate()))) { throw new Exception(Exception::USER_UNAUTHORIZED); } try { - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); + $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php index eccacaafd2..ca376842e2 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php @@ -14,6 +14,7 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Exception\NotFound as NotFoundException; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -64,6 +65,7 @@ class Delete extends Action ->inject('queueForEvents') ->inject('deviceForFiles') ->inject('queueForDeletes') + ->inject('authorization') ->callback($this->action(...)); } @@ -75,33 +77,33 @@ class Delete extends Action Event $queueForEvents, Device $deviceForFiles, DeleteEvent $queueForDeletes, + Authorization $authorization ) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_DELETE); - $valid = $validator->isValid($bucket->getDelete()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_DELETE, $bucket->getDelete())); if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } // Read permission should not be required for delete - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } // Make sure we don't delete the file before the document permission check occurs - if ($fileSecurity && !$valid && !$validator->isValid($file->getDelete())) { - throw new Exception(Exception::USER_UNAUTHORIZED); + if ($fileSecurity && !$valid && !$authorization->isValid(new Input(Database::PERMISSION_DELETE, $file->getDelete()))) { + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } $deviceDeleted = false; @@ -125,7 +127,7 @@ class Delete extends Action if ($fileSecurity && !$valid) { $deleted = $dbForProject->deleteDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $deleted = Authorization::skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getSequence(), $fileId)); + $deleted = $authorization->skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getSequence(), $fileId)); } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php index 45e3b83375..bbceff51ec 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php @@ -14,6 +14,7 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -68,6 +69,7 @@ class Get extends Action ->inject('mode') ->inject('resourceToken') ->inject('deviceForFiles') + ->inject('authorization') ->callback($this->action(...)); } @@ -80,13 +82,14 @@ class Get extends Action Database $dbForProject, string $mode, Document $resourceToken, - Device $deviceForFiles + Device $deviceForFiles, + Authorization $authorization, ) { /* @type Document $bucket */ - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -94,17 +97,16 @@ class Get extends Action $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid && !$isToken) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { /* @type Document $file */ - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Get.php index 77f163e5fb..caaab29efc 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Get.php @@ -10,6 +10,7 @@ use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -49,6 +50,7 @@ class Get extends Action ->param('fileId', '', new UID(), 'File ID.') ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } @@ -57,27 +59,27 @@ class Get extends Action string $fileId, Response $response, Database $dbForProject, + Authorization $authorization ) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($file->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php index 9c4e49d0bb..7ab3e713bc 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php @@ -17,6 +17,7 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Image\Image; use Utopia\Platform\Action; @@ -90,6 +91,7 @@ class Get extends Action ->inject('deviceForFiles') ->inject('deviceForLocal') ->inject('project') + ->inject('authorization') ->callback($this->action(...)); } @@ -114,7 +116,8 @@ class Get extends Action Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal, - Document $project + Document $project, + Authorization $authorization ) { if (!\extension_loaded('imagick')) { @@ -122,10 +125,10 @@ class Get extends Action } /* @type Document $bucket */ - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -137,17 +140,16 @@ class Get extends Action $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid && !$isToken) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { /* @type Document $file */ - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { @@ -269,11 +271,11 @@ class Get extends Action $contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg']; //Do not update transformedAt if it's a console user - if (!User::isPrivileged(Authorization::getRoles())) { + if (!User::isPrivileged($authorization->getRoles())) { $transformedAt = $file->getAttribute('transformedAt', ''); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) { $file->setAttribute('transformedAt', DateTime::now()); - Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file)); + $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file)); } } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php index 67372435b1..516343e23f 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php @@ -51,6 +51,7 @@ class Get extends Action ->inject('project') ->inject('mode') ->inject('deviceForFiles') + ->inject('authorization') ->callback($this->action(...)); } @@ -64,7 +65,8 @@ class Get extends Action Database $dbForPlatform, Document $project, string $mode, - Device $deviceForFiles + Device $deviceForFiles, + Authorization $authorization ) { $decoder = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 0); @@ -86,15 +88,15 @@ class Get extends Action $disposition = $decoded['disposition'] ?? 'inline'; $dbForProject = $isInternal ? $dbForPlatform : $dbForProject; - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Update.php index be78cc358b..57856c1564 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Update.php @@ -14,6 +14,7 @@ use Utopia\Database\Exception\NotFound as NotFoundException; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -62,6 +63,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } @@ -72,26 +74,26 @@ class Update extends Action ?array $permissions, Response $response, Database $dbForProject, - Event $queueForEvents + Event $queueForEvents, + Authorization $authorization ) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_UPDATE); - $valid = $validator->isValid($bucket->getUpdate()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_UPDATE, $bucket->getUpdate())); if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } // Read permission should not be required for update - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -105,7 +107,7 @@ class Update extends Action ]); // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); + $roles = $authorization->getRoles(); if (!User::isApp($roles) && !User::isPrivileged($roles) && !\is_null($permissions)) { foreach (Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { @@ -118,7 +120,7 @@ class Update extends Action $permission->getIdentifier(), $permission->getDimension() ))->toString(); - if (!Authorization::isRole($role)) { + if (!$authorization->hasRole($role)) { throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); } } @@ -139,7 +141,7 @@ class Update extends Action if ($fileSecurity && !$valid) { $file = $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file); } else { - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); + $file = $authorization->skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php index 41ee95b165..3874fedacf 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php @@ -15,6 +15,7 @@ use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -69,6 +70,7 @@ class Get extends Action ->inject('mode') ->inject('resourceToken') ->inject('deviceForFiles') + ->inject('authorization') ->callback($this->action(...)); } @@ -81,13 +83,14 @@ class Get extends Action Database $dbForProject, string $mode, Document $resourceToken, - Device $deviceForFiles + Device $deviceForFiles, + Authorization $authorization ) { /* @type Document $bucket */ - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -95,17 +98,16 @@ class Get extends Action $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid && !$isToken) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { /* @type Document $file */ - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/XList.php index e46fdb2a0a..3663b56fab 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/XList.php @@ -16,6 +16,7 @@ use Utopia\Database\Exception\Order as OrderException; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Query\Cursor; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -61,6 +62,7 @@ class XList extends Action ->inject('response') ->inject('dbForProject') ->inject('mode') + ->inject('authorization') ->callback($this->action(...)); } @@ -71,22 +73,22 @@ class XList extends Action bool $includeTotal, Response $response, Database $dbForProject, - string $mode + string $mode, + Authorization $authorization ) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(\Utopia\Database\Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); + $valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead())); if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } try { @@ -119,7 +121,7 @@ class XList extends Action if ($fileSecurity && !$valid) { $cursorDocument = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $cursorDocument = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($cursorDocument->isEmpty()) { @@ -136,8 +138,8 @@ class XList extends Action $files = $dbForProject->find('bucket_' . $bucket->getSequence(), $queries); $total = $includeTotal ? $dbForProject->count('bucket_' . $bucket->getSequence(), $filterQueries, APP_LIMIT_COUNT) : 0; } else { - $files = Authorization::skip(fn () => $dbForProject->find('bucket_' . $bucket->getSequence(), $queries)); - $total = $includeTotal ? Authorization::skip(fn () => $dbForProject->count('bucket_' . $bucket->getSequence(), $filterQueries, APP_LIMIT_COUNT)) : 0; + $files = $authorization->skip(fn () => $dbForProject->find('bucket_' . $bucket->getSequence(), $queries)); + $total = $includeTotal ? $authorization->skip(fn () => $dbForProject->count('bucket_' . $bucket->getSequence(), $filterQueries, APP_LIMIT_COUNT)) : 0; } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Get.php index 5c3515122b..4e75de27c8 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Get.php @@ -51,6 +51,7 @@ class Get extends Action ->inject('dbForProject') ->inject('project') ->inject('getLogsDB') + ->inject('authorization') ->callback($this->action(...)); } @@ -59,7 +60,8 @@ class Get extends Action Response $response, Database $dbForProject, Document $project, - callable $getLogsDB + callable $getLogsDB, + Authorization $authorization, ): void { $bucket = $dbForProject->getDocument('buckets', $bucketId); @@ -75,19 +77,20 @@ class Get extends Action $statsDocId = md5('_inf_' . $metric); - $dbForLogs = call_user_func($getLogsDB, $project); - $storageStats = Authorization::skip( - fn () => $dbForLogs->getDocument( + $totalSize = 0; + + try { + $dbForLogs = $getLogsDB($project); + $storageStats = $authorization->skip(fn () => $dbForLogs->getDocument( 'stats', $statsDocId, [Query::select(['value'])] - ) - ); + )); - /** - * The value can be 0 if stats were not aggregated when this request was made! - */ - $totalSize = $storageStats->isEmpty() ? 0 : $storageStats->getAttribute('value', 0); + $totalSize = $storageStats->getAttribute('value', 0); + } catch (\Throwable) { + // Stats may not be available, default to 0 + } $bucket->setAttribute('totalSize', $totalSize); diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/XList.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/XList.php index a2c880ce08..601d9b5321 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/XList.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/XList.php @@ -58,6 +58,7 @@ class XList extends Action ->inject('dbForProject') ->inject('project') ->inject('getLogsDB') + ->inject('authorization') ->callback($this->action(...)); } @@ -68,7 +69,8 @@ class XList extends Action Response $response, Database $dbForProject, Document $project, - callable $getLogsDB + callable $getLogsDB, + Authorization $authorization ) { try { $queries = Query::parseQueries($queries); @@ -117,7 +119,6 @@ class XList extends Action if (!empty($buckets)) { $bucketByStatsId = []; - $dbForLogs = call_user_func($getLogsDB, $project); foreach ($buckets as $bucket) { $metric = str_replace( @@ -134,22 +135,28 @@ class XList extends Action $bucket->setAttribute('totalSize', 0); } - /* @type Document[] $stats */ - $stats = Authorization::skip(function () use ($dbForLogs, $bucketByStatsId) { - $statsIds = array_keys($bucketByStatsId); + try { + $dbForLogs = $getLogsDB($project); - return $dbForLogs->find('stats', [ - Query::equal('$id', $statsIds), - Query::select(['value']), - ]); - }); + /* @var array $stats */ + $stats = $authorization->skip(function () use ($dbForLogs, $bucketByStatsId) { + $statsIds = array_keys($bucketByStatsId); - foreach ($stats as $stat) { - $bucket = $bucketByStatsId[$stat->getId()]; + return $dbForLogs->find('stats', [ + Query::equal('$id', $statsIds), + Query::select(['value']), + ]); + }); - if ($bucket) { - $bucket->setAttribute('totalSize', $stat->getAttribute('value', 0)); + foreach ($stats as $stat) { + $bucket = $bucketByStatsId[$stat->getId()]; + + if ($bucket) { + $bucket->setAttribute('totalSize', $stat->getAttribute('value', 0)); + } } + } catch (\Throwable) { + // Stats may not be available, default to 0 } } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Usage/Get.php index b816e83f72..a7bda355da 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Usage/Get.php @@ -54,10 +54,11 @@ class Get extends Action ->inject('project') ->inject('dbForProject') ->inject('getLogsDB') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $bucketId, string $range, Response $response, Document $project, Database $dbForProject, callable $getLogsDB) + public function action(string $bucketId, string $range, Response $response, Document $project, Database $dbForProject, callable $getLogsDB, Authorization $authorization) { $dbForLogs = call_user_func($getLogsDB, $project); $bucket = $dbForProject->getDocument('buckets', $bucketId); @@ -75,7 +76,7 @@ class Get extends Action str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED), ]; - Authorization::skip(function () use ($dbForProject, $dbForLogs, $bucket, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $dbForLogs, $bucket, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $db = ($metric === str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED)) ? $dbForLogs diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Storage/Http/Usage/XList.php index d29fa7c1b4..44fdd54e8c 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Usage/XList.php @@ -49,10 +49,11 @@ class XList extends Action ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $range, Response $response, Database $dbForProject) + public function action(string $range, Response $response, Database $dbForProject, Authorization $authorization) { $periods = Config::getParam('usage', []); $stats = $usage = []; @@ -63,7 +64,7 @@ class XList extends Action METRIC_FILES_STORAGE, ]; - Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { + $authorization->skip(function () use ($dbForProject, $days, $metrics, &$stats) { foreach ($metrics as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php index f79dece530..5f1bd55788 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php @@ -6,32 +6,31 @@ use Appwrite\Extend\Exception; use Appwrite\Utopia\Database\Documents\User; use Utopia\Database\Database; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Platform\Action as UtopiaAction; class Action extends UtopiaAction { - protected function getFileAndBucket(Database $dbForProject, string $bucketId, string $fileId): array + protected function getFileAndBucket(Database $dbForProject, Authorization $authorization, string $bucketId, string $fileId): array { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isAPIKey = User::isApp(Authorization::getRoles()); - $isPrivilegedUser = User::isPrivileged(Authorization::getRoles()); + $isAPIKey = User::isApp($authorization->getRoles()); + $isPrivilegedUser = User::isPrivileged($authorization->getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $validator = new Authorization(Database::PERMISSION_READ); - $valid = $validator->isValid($bucket->getRead()); - if (!$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); + if (!$authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead()))) { + throw new Exception(Exception::USER_UNAUTHORIZED, $authorization->getDescription()); } $fileSecurity = $bucket->getAttribute('fileSecurity', false); if ($fileSecurity) { $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); + $file = $authorization->skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($file->isEmpty()) { diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php index 3d1f6eef38..6cbaeaa915 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php @@ -14,6 +14,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Authorization\Input; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\UID; use Utopia\Platform\Scope\HTTP; @@ -65,23 +66,23 @@ class Create extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents): void + public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents, Authorization $authorization): void { /** * @var Document $bucket * @var Document $file */ - ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $bucketId, $fileId); + ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $authorization, $bucketId, $fileId); $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_UPDATE); - $bucketPermission = $validator->isValid($bucket->getUpdate()); + $bucketPermission = $authorization->isValid(new Input(Database::PERMISSION_UPDATE, $bucket->getUpdate())); if ($fileSecurity) { - $filePermission = $validator->isValid($file->getUpdate()); + $filePermission = $authorization->isValid(new Input(Database::PERMISSION_UPDATE, $file->getUpdate())); if (!$bucketPermission && !$filePermission) { throw new Exception(Exception::USER_UNAUTHORIZED); } diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php index 8a9301713b..13da92cbc6 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php @@ -13,6 +13,7 @@ use Exception; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Boolean; @@ -57,12 +58,13 @@ class XList extends Action ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('response') ->inject('dbForProject') + ->inject('authorization') ->callback($this->action(...)); } - public function action(string $bucketId, string $fileId, array $queries, bool $includeTotal, Response $response, Database $dbForProject) + public function action(string $bucketId, string $fileId, array $queries, bool $includeTotal, Response $response, Database $dbForProject, Authorization $authorization) { - ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $bucketId, $fileId); + ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $authorization, $bucketId, $fileId); $queries = Query::parseQueries($queries); $queries[] = Query::equal('resourceType', [TOKENS_RESOURCE_TYPE_FILES]); diff --git a/src/Appwrite/Platform/Tasks/Migrate.php b/src/Appwrite/Platform/Tasks/Migrate.php index 3e35c1c1fa..cc6981fa1b 100644 --- a/src/Appwrite/Platform/Tasks/Migrate.php +++ b/src/Appwrite/Platform/Tasks/Migrate.php @@ -31,6 +31,7 @@ class Migrate extends Action ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('register') + ->inject('authorisation') ->callback($this->action(...)); } @@ -47,8 +48,8 @@ class Migrate extends Action Database $dbForPlatform, callable $getProjectDB, Registry $register, + Authorization $authorization ): void { - Authorization::disable(); if (!\array_key_exists($version, Migration::$versions)) { Console::error("No migration found for version $version."); @@ -66,14 +67,14 @@ class Migrate extends Action $count = 0; $total = $dbForPlatform->count('projects') + 1; - $dbForPlatform->foreach('projects', function (Document $project) use ($dbForPlatform, $getProjectDB, $register, $migration, &$count, $total) { + $dbForPlatform->foreach('projects', function (Document $project) use ($dbForPlatform, $getProjectDB, $register, $migration, &$count, $total, $authorization) { /** @var Database $dbForProject */ $dbForProject = $getProjectDB($project); $dbForProject->disableValidation(); try { $migration - ->setProject($project, $dbForProject, $dbForPlatform, $getProjectDB) + ->setProject($project, $dbForProject, $dbForPlatform, $authorization, $getProjectDB) ->setPDO($register->get('db', true)) ->execute(); } catch (\Throwable $th) { @@ -88,7 +89,7 @@ class Migrate extends Action try { $migration - ->setProject($console, $getProjectDB($console), $dbForPlatform, $getProjectDB) + ->setProject($console, $getProjectDB($console), $dbForPlatform, $authorization, $getProjectDB) ->setPDO($register->get('db', true)) ->execute(); } catch (\Throwable $th) { diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index c3a67d7fbb..8a3eef2d34 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -399,7 +399,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setDefaultHeaders([ 'X-Appwrite-Response-Format' => '1.8.0', ]) - ->setExclude($language['exclude'] ?? []); + ->setExclude($language['exclude'] ?? []) + ->setTest(false); // Make sure we have a clean slate. // Otherwise, all files in this dir will be pushed, diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 9698fe9034..19ed3bc099 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -8,7 +8,6 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; use Utopia\Queue\Broker\Pool as BrokerPool; use Utopia\System\System; @@ -61,7 +60,7 @@ abstract class ScheduleBase extends Action $accessedAt = $project->getAttribute('accessedAt', 0); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $accessedAt) { $project->setAttribute('accessedAt', DateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); + $dbForPlatform->updateDocument('projects', $project->getId(), $project); } } } diff --git a/src/Appwrite/Platform/Tasks/StatsResources.php b/src/Appwrite/Platform/Tasks/StatsResources.php index b64dd61f86..6d04d2109a 100644 --- a/src/Appwrite/Platform/Tasks/StatsResources.php +++ b/src/Appwrite/Platform/Tasks/StatsResources.php @@ -8,7 +8,6 @@ use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\System\System; /** @@ -61,9 +60,7 @@ class StatsResources extends Action $interval = (int) System::getEnv('_APP_STATS_RESOURCES_INTERVAL', '3600'); - Console::loop(function () use ($queue) { - Authorization::disable(); - Authorization::setDefaultStatus(false); + Console::loop(function () use ($queue, $dbForPlatform) { $last24Hours = (new \DateTime())->sub(\DateInterval::createFromDateString('24 hours')); /** diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 5132687279..33ebd39092 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -21,6 +21,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; +use Utopia\Database\Exception\NotFound; use Utopia\Database\Exception\Structure; use Utopia\Database\Helpers\ID; use Utopia\Database\Query; @@ -58,6 +59,7 @@ class Certificates extends Action ->inject('log') ->inject('certificates') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -72,6 +74,8 @@ class Certificates extends Action * @param Certificate $queueForCertificates * @param Log $log * @param CertificatesAdapter $certificates + * @param array $plan + * @param ValidatorAuthorization $authorization * @return void * @throws Throwable * @throws \Utopia\Database\Exception @@ -87,7 +91,8 @@ class Certificates extends Action Certificate $queueForCertificates, Log $log, CertificatesAdapter $certificates, - array $plan + array $plan, + ValidatorAuthorization $authorization, ): void { $payload = $message->getPayload() ?? []; @@ -106,11 +111,11 @@ class Certificates extends Action switch ($action) { case Certificate::ACTION_DOMAIN_VERIFICATION: - $this->handleDomainVerificationAction($domain, $dbForPlatform, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $queueForCertificates, $log, $validationDomain); + $this->handleDomainVerificationAction($domain, $dbForPlatform, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $queueForCertificates, $log, $authorization, $validationDomain); break; case Certificate::ACTION_GENERATION: - $this->handleCertificateGenerationAction($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan, $validationDomain); + $this->handleCertificateGenerationAction($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $authorization, $skipRenewCheck, $plan, $validationDomain); break; default: @@ -127,10 +132,12 @@ class Certificates extends Action * @param Realtime $queueForRealtime * @param Certificate $queueForCertificates * @param Log $log + * @param ValidatorAuthorization $authorization * @param string|null $validationDomain * @return void - * @throws Throwable * @throws \Utopia\Database\Exception + * @throws NotFound + * @throws \Utopia\Database\Exception\Query */ private function handleDomainVerificationAction( Domain $domain, @@ -141,12 +148,13 @@ class Certificates extends Action Realtime $queueForRealtime, Certificate $queueForCertificates, Log $log, + ValidatorAuthorization $authorization, ?string $validationDomain = null ): void { // Get rule $rule = System::getEnv('_APP_RULES_FORMAT') === 'md5' - ? ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get()))) - : ValidatorAuthorization::skip(fn () => $dbForPlatform->findOne('rules', [ + ? $authorization->skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get()))) + : $authorization->skip(fn () => $dbForPlatform->findOne('rules', [ Query::equal('domain', [$domain->get()]), Query::limit(1), ])); @@ -195,15 +203,23 @@ class Certificates extends Action * @param Database $dbForPlatform * @param Mail $queueForMails * @param Event $queueForEvents + * @param Webhook $queueForWebhooks * @param Func $queueForFunctions * @param Realtime $queueForRealtime + * @param Log $log * @param CertificatesAdapter $certificates + * @param ValidatorAuthorization $authorization * @param bool $skipRenewCheck * @param array $plan * @param string|null $validationDomain * @return void + * @throws Authorization + * @throws Conflict + * @throws NotFound + * @throws Structure * @throws Throwable * @throws \Utopia\Database\Exception + * @throws \Utopia\Database\Exception\Query */ private function handleCertificateGenerationAction( Domain $domain, @@ -216,6 +232,7 @@ class Certificates extends Action Realtime $queueForRealtime, Log $log, CertificatesAdapter $certificates, + ValidatorAuthorization $authorization, bool $skipRenewCheck = false, array $plan = [], ?string $validationDomain = null @@ -252,8 +269,8 @@ class Certificates extends Action // Get rule document for domain // TODO: (@Meldiron) Remove after 1.7.x migration $rule = System::getEnv('_APP_RULES_FORMAT') === 'md5' - ? ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get()))) - : ValidatorAuthorization::skip(fn () => $dbForPlatform->findOne('rules', [ + ? $authorization->skip(fn () => $dbForPlatform->getDocument('rules', md5($domain->get()))) + : $authorization->skip(fn () => $dbForPlatform->findOne('rules', [ Query::equal('domain', [$domain->get()]), Query::limit(1), ])); diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 0b2f7c75ae..9687f4f4bb 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -19,12 +19,10 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception as DatabaseException; -use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization as ValidatorAuthorization; use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\Platform\Action; @@ -203,7 +201,6 @@ class Deletes extends Action * @param string $datetime * @param Document|null $document * @return void - * @throws Authorization * @throws Conflict * @throws Restricted * @throws Structure @@ -1002,14 +999,14 @@ class Deletes extends Action } Console::info("Deleting screenshots for deployment " . $deployment->getId()); - $bucket = ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')); + $bucket = $dbForPlatform->getDocument('buckets', 'screenshots'); if ($bucket->isEmpty()) { Console::error('Failed to get bucket for deployment screenshots'); return; } foreach ($screenshotIds as $id) { - $file = ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $id)); + $file = $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $id); if ($file->isEmpty()) { Console::error('Failed to get deployment screenshot: ' . $id); diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index fba5154079..e053efa021 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -8,6 +8,7 @@ use Appwrite\Event\Func; use Appwrite\Event\Realtime; use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; +use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Utopia\Response\Model\Execution; use Exception; use Executor\Executor; @@ -15,7 +16,6 @@ use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\Structure; use Utopia\Database\Helpers\ID; @@ -337,7 +337,6 @@ class Functions extends Action * @param string|null $eventData * @param string|null $executionId * @return void - * @throws Authorization * @throws Structure * @throws \Utopia\Database\Exception * @throws Conflict @@ -464,7 +463,11 @@ class Functions extends Action if ($execution->getAttribute('status') !== 'processing') { $execution->setAttribute('status', 'processing'); - $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + try { + $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + } catch (\Throwable $e) { + $log->addExtra('updateError', $e->getMessage()); + } } $durationStart = \microtime(true); @@ -607,6 +610,13 @@ class Functions extends Action $error = $th->getMessage(); $errorCode = $th->getCode(); } finally { + /** Update execution status */ + try { + $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + } catch (\Throwable $e) { + $log->addExtra('updateError', $e->getMessage()); + } + /** Trigger usage queue */ $queueForStatsUsage ->setProject($project) @@ -623,8 +633,6 @@ class Functions extends Action ; } - $execution = $dbForProject->updateDocument('executions', $executionId, $execution); - $executionModel = new Execution(); $realtimeExecution = $executionModel->filter(new Document($execution->getArrayCopy())); $realtimeExecution = $realtimeExecution->getArrayCopy(\array_keys($executionModel->getRules())); @@ -654,7 +662,11 @@ class Functions extends Action ->trigger(); if (!empty($error)) { - throw new Exception($error, $errorCode); + throw new AppwriteException( + AppwriteException::GENERAL_SERVER_ERROR, + $error ?: 'Function execution failed with no error message', + $errorCode + ); } } } diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index e1039510f4..6ef2f1899c 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -80,6 +80,7 @@ class Migrations extends Action ->inject('deviceForFiles') ->inject('queueForMails') ->inject('plan') + ->inject('authorization') ->callback($this->action(...)); } @@ -97,6 +98,7 @@ class Migrations extends Action Device $deviceForFiles, Mail $queueForMails, array $plan, + Authorization $authorization, ): void { $payload = $message->getPayload() ?? []; $this->deviceForMigrations = $deviceForMigrations; @@ -134,7 +136,13 @@ class Migrations extends Action } try { - $this->processMigration($migration, $queueForRealtime, $queueForMails, $platform); + $this->processMigration( + $migration, + $queueForRealtime, + $queueForMails, + $platform, + $authorization + ); } finally { $this->dbForProject = null; $this->dbForPlatform = null; @@ -145,7 +153,7 @@ class Migrations extends Action $this->plan = []; $this->sourceReport = []; - gc_collect_cycles(); + \gc_collect_cycles(); } } @@ -319,6 +327,7 @@ class Migrations extends Action Realtime $queueForRealtime, Mail $queueForMails, array $platform, + Authorization $authorization, ): void { $project = $this->project; @@ -435,14 +444,14 @@ class Migrations extends Action $destination?->success(); $source?->success(); - // todo: Move to CSV hook + // TODO: Move to CSV hook if ($migration->getAttribute('destination') === DestinationCSV::getName()) { - $this->handleCSVExportComplete($project, $migration, $queueForMails, $queueForRealtime, $platform); + $this->handleCSVExportComplete($project, $migration, $queueForMails, $queueForRealtime, $platform, $authorization); } } } finally { - $source?->cleanUp(); - $destination?->cleanUp(); + $source?->cleanup(); + $destination?->cleanup(); $transfer = null; $source = null; @@ -457,11 +466,10 @@ class Migrations extends Action * @param Document $project * @param Document $migration * @param Mail $queueForMails + * @param Realtime $queueForRealtime + * @param array $platform + * @param Authorization $authorization * @return void - * @throws AuthorizationException - * @throws Structure - * @throws \Utopia\Database\Exception - * @throws Exception */ protected function handleCSVExportComplete( Document $project, @@ -469,6 +477,7 @@ class Migrations extends Action Mail $queueForMails, Realtime $queueForRealtime, array $platform, + Authorization $authorization, ): void { $options = $migration->getAttribute('options', []); $bucketId = 'default'; // Always use platform default bucket @@ -482,7 +491,7 @@ class Migrations extends Action throw new \Exception('User ' . $userInternalId . ' not found'); } - $bucket = Authorization::skip(fn () => $this->dbForPlatform->getDocument('buckets', $bucketId)); + $bucket = $authorization->skip(fn () => $this->dbForPlatform->getDocument('buckets', $bucketId)); if ($bucket->isEmpty()) { throw new \Exception('Bucket not found'); } diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index 3d2ebad556..7cb03c8e1b 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -40,17 +40,46 @@ abstract class Format 'license.url' => '', ]; - /* - * Blacklist to omit the enum types for the given route's parameter - */ - protected array $enumBlacklist = [ + private const array OAUTH_PROVIDER_BLACKLIST = [ + [ + 'namespace' => 'account', + 'methods' => [ + 'createOAuth2Session', + 'createOAuth2Token', + 'updateMagicURLSession' + ], + 'parameter' => 'provider', + 'excludeKeys' => [ + 'mock', + 'mock-unverified' + ], + ], + [ + 'namespace' => 'projects', + 'methods' => [ + 'updateOAuth2' + ], + 'parameter' => 'provider', + 'excludeKeys' => [ + 'mock', + 'mock-unverified' + ], + ], + ]; + + private const array PROVIDER_USAGE_BLACKLIST = [ [ 'namespace' => 'users', - 'method' => 'getUsage', - 'parameter' => 'provider' - ] + 'methods' => [ + 'getUsage' + ], + 'parameter' => 'provider', + 'exclude' => true, /* fully excluded */ + ], ]; + protected array $enumBlacklist = []; + public function __construct(App $app, array $services, array $routes, array $models, array $keys, int $authCount, string $platform) { $this->app = $app; @@ -60,6 +89,49 @@ abstract class Format $this->keys = $keys; $this->authCount = $authCount; $this->platform = $platform; + + $this->enumBlacklist = $this->buildEnumBlacklist(); + } + + protected function buildEnumBlacklist(): array + { + $blacklist = []; + + foreach (self::OAUTH_PROVIDER_BLACKLIST as $config) { + foreach ($config['methods'] as $method) { + $entry = [ + 'namespace' => $config['namespace'], + 'method' => $method, + 'parameter' => $config['parameter'], + ]; + if (isset($config['excludeKeys'])) { + $entry['excludeKeys'] = $config['excludeKeys']; + } + if (isset($config['exclude'])) { + $entry['exclude'] = $config['exclude']; + } + $blacklist[] = $entry; + } + } + + foreach (self::PROVIDER_USAGE_BLACKLIST as $config) { + foreach ($config['methods'] as $method) { + $entry = [ + 'namespace' => $config['namespace'], + 'method' => $method, + 'parameter' => $config['parameter'], + ]; + if (isset($config['excludeKeys'])) { + $entry['excludeKeys'] = $config['excludeKeys']; + } + if (isset($config['exclude'])) { + $entry['exclude'] = $config['exclude']; + } + $blacklist[] = $entry; + } + } + + return $blacklist; } /** @@ -594,171 +666,16 @@ abstract class Format public function getResponseEnumName(string $model, string $param): ?string { - switch ($model) { - case 'attributeString': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeInteger': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeFloat': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeBoolean': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeEmail': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeEnum': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeIp': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeUrl': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeDatetime': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeRelationship': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributePoint': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributeLine': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'attributePolygon': - switch ($param) { - case 'status': - return 'AttributeStatus'; - } - break; - case 'columnString': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnInteger': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnFloat': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnBoolean': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnEmail': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnEnum': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnIp': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnUrl': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnDatetime': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnRelationship': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnPoint': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnLine': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'columnPolygon': - switch ($param) { - case 'status': - return 'ColumnStatus'; - } - break; - case 'healthStatus': - switch ($param) { - case 'status': - return 'HealthCheckStatus'; - } - break; + if ($param !== 'status') { + return null; } - return null; + + return match (true) { + $model === 'healthStatus' => 'HealthCheckStatus', + str_starts_with($model, 'attribute') => 'AttributeStatus', + str_starts_with($model, 'column') => 'ColumnStatus', + default => null, + }; } protected function getNestedModels(Model $model, array &$usedModels): void @@ -780,4 +697,31 @@ abstract class Format } } } + + protected function parseDescription(string $description, array $excludedValues): string + { + if (empty($excludedValues)) { + return $description; + } + + foreach ($excludedValues as $excludedValue) { + // remove from comma-separated list + $description = preg_replace( + '/,\s*' . preg_quote($excludedValue, '/') . '(?=\s*[,.]|$)/', + '', + $description + ); + $description = preg_replace( + '/(?<=:\s|,\s)' . preg_quote($excludedValue, '/') . '\s*,\s*/', + '', + $description + ); + } + + // clean up double commas and extra spaces + $description = preg_replace('/,\s*,/', ',', $description); + $description = preg_replace('/\s+/', ' ', $description); + + return trim($description); + } } diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 00e98afb60..8171a45db4 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -550,7 +550,7 @@ class OpenAPI3 extends Format break; case 'Utopia\Validator\Integer': $node['schema']['type'] = $validator->getType(); - $node['schema']['format'] = 'int32'; + $node['schema']['format'] = $validator->getFormat(); if (!empty($param['example'])) { $node['schema']['x-example'] = $param['example']; } @@ -584,23 +584,52 @@ class OpenAPI3 extends Format // Iterate from the blackList. If it matches with the current one, then it is a blackList // Do not add the enum $allowed = true; + $excludeKeys = null; foreach ($this->enumBlacklist as $blacklist) { if ( $blacklist['namespace'] == $sdk->getNamespace() && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name ) { - $allowed = false; + // 'exclude' => true means full exclude + if (isset($blacklist['exclude']) && $blacklist['exclude'] === true) { + $allowed = false; + break; + } + + if (isset($blacklist['excludeKeys'])) { + $excludeKeys = $blacklist['excludeKeys']; + } break; } } if ($allowed && $validator->getType() === 'string') { - $node['schema']['items']['enum'] = \array_values($validator->getList()); + $allValues = \array_values($validator->getList()); + $allKeys = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); + + if ($excludeKeys !== null) { + $keepIndices = []; + foreach ($allValues as $index => $value) { + if (!\in_array($value, $excludeKeys, true)) { + $keepIndices[] = $index; + } + } + $enumKeys = \array_values(\array_intersect_key($allKeys, \array_flip($keepIndices))); + $enumValues = \array_values(\array_intersect_key($allValues, \array_flip($keepIndices))); + } else { + $enumKeys = $allKeys; + $enumValues = $allValues; + } + $node['schema']['items']['enum'] = $enumValues; $node['schema']['items']['x-enum-name'] = $this->getRequestEnumName($sdk->getNamespace() ?? '', $methodName, $name); - $node['schema']['items']['x-enum-keys'] = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); + $node['schema']['items']['x-enum-keys'] = $enumKeys; + + if (!empty($excludeKeys)) { + $node['description'] = $this->parseDescription($node['description'], $excludeKeys); + } } if ($validator->getType() === 'integer') { - $node['schema']['items']['format'] = 'int32'; + $node['schema']['items']['format'] = $validator->getFormat() ?? 'int32'; } } else { $node['schema']['type'] = $validator->getType(); @@ -609,23 +638,52 @@ class OpenAPI3 extends Format // Iterate from the blackList. If it matches with the current one, then it is a blackList // Do not add the enum $allowed = true; + $excludeKeys = null; foreach ($this->enumBlacklist as $blacklist) { if ( $blacklist['namespace'] == $sdk->getNamespace() && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name ) { - $allowed = false; + // 'exclude' => true means full exclude + if (isset($blacklist['exclude']) && $blacklist['exclude'] === true) { + $allowed = false; + break; + } + + if (isset($blacklist['excludeKeys'])) { + $excludeKeys = $blacklist['excludeKeys']; + } break; } } if ($allowed && $validator->getType() === 'string') { - $node['schema']['enum'] = \array_values($validator->getList()); + $allValues = \array_values($validator->getList()); + $allKeys = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); + + if ($excludeKeys !== null) { + $keepIndices = []; + foreach ($allValues as $index => $value) { + if (!\in_array($value, $excludeKeys, true)) { + $keepIndices[] = $index; + } + } + $enumKeys = \array_values(\array_intersect_key($allKeys, \array_flip($keepIndices))); + $enumValues = \array_values(\array_intersect_key($allValues, \array_flip($keepIndices))); + } else { + $enumKeys = $allKeys; + $enumValues = $allValues; + } + $node['schema']['enum'] = $enumValues; $node['schema']['x-enum-name'] = $this->getRequestEnumName($sdk->getNamespace() ?? '', $methodName, $name); - $node['schema']['x-enum-keys'] = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); + $node['schema']['x-enum-keys'] = $enumKeys; + + if (!empty($excludeKeys)) { + $node['description'] = $this->parseDescription($node['description'], $excludeKeys); + } } if ($validator->getType() === 'integer') { - $node['format'] = 'int32'; + $node['schema']['format'] = $validator->getFormat() ?? 'int32'; } } break; @@ -694,6 +752,10 @@ class OpenAPI3 extends Format 'x-example' => $node['schema']['x-example'] ?? null ]; + if (isset($node['schema']['format'])) { + $body['content'][$consumes[0]]['schema']['properties'][$name]['format'] = $node['schema']['format']; + } + if (isset($node['schema']['enum'])) { /// If the enum flag is Set, add the enum values to the body $body['content'][$consumes[0]]['schema']['properties'][$name]['enum'] = $node['schema']['enum']; @@ -795,7 +857,7 @@ class OpenAPI3 extends Format case 'integer': $type = 'integer'; - $format = 'int32'; + $format = $rule['format'] ?? 'int32'; break; case 'float': diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 37173c51c6..990c456851 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -539,7 +539,7 @@ class Swagger2 extends Format break; case 'Utopia\Validator\Integer': $node['type'] = $validator->getType(); - $node['format'] = 'int32'; + $node['format'] = $validator->getFormat(); if (!empty($param['example'])) { $node['x-example'] = $param['example']; } @@ -571,41 +571,97 @@ class Swagger2 extends Format $node['x-example'] = $param['example']; } - // Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; + $excludeKeys = null; foreach ($this->enumBlacklist as $blacklist) { if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name) { - $allowed = false; + // 'exclude' => true means full exclude + if (isset($blacklist['exclude']) && $blacklist['exclude'] === true) { + $allowed = false; + break; + } + + if (isset($blacklist['excludeKeys'])) { + $excludeKeys = $blacklist['excludeKeys']; + } break; } } if ($allowed && $validator->getType() === 'string') { - $node['items']['enum'] = \array_values($validator->getList()); + $allValues = \array_values($validator->getList()); + $allKeys = $this->getRequestEnumKeys($namespace, $methodName, $name); + + if ($excludeKeys !== null) { + $keepIndices = []; + foreach ($allValues as $index => $value) { + if (!\in_array($value, $excludeKeys, true)) { + $keepIndices[] = $index; + } + } + $enumKeys = \array_values(\array_intersect_key($allKeys, \array_flip($keepIndices))); + $enumValues = \array_values(\array_intersect_key($allValues, \array_flip($keepIndices))); + } else { + $enumKeys = $allKeys; + $enumValues = $allValues; + } + $node['items']['enum'] = $enumValues; $node['items']['x-enum-name'] = $this->getRequestEnumName($namespace, $methodName, $name); - $node['items']['x-enum-keys'] = $this->getRequestEnumKeys($namespace, $methodName, $name); + $node['items']['x-enum-keys'] = $enumKeys; + + if (!empty($excludeKeys)) { + $node['description'] = $this->parseDescription($node['description'], $excludeKeys); + } } if ($validator->getType() === 'integer') { - $node['items']['format'] = 'int32'; + $node['items']['format'] = $validator->getFormat() ?? 'int32'; } } else { $node['type'] = $validator->getType(); $node['x-example'] = ($param['example'] ?? '') ?: $validator->getList()[0]; - // Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; + $excludeKeys = null; foreach ($this->enumBlacklist as $blacklist) { if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $methodName && $blacklist['parameter'] == $name) { - $allowed = false; + // 'exclude' => true means full exclude + if (isset($blacklist['exclude']) && $blacklist['exclude'] === true) { + $allowed = false; + break; + } + + if (isset($blacklist['excludeKeys'])) { + $excludeKeys = $blacklist['excludeKeys']; + } break; } } if ($allowed && $validator->getType() === 'string') { - $node['enum'] = \array_values($validator->getList()); + $allValues = \array_values($validator->getList()); + $allKeys = $this->getRequestEnumKeys($namespace, $methodName, $name); + + if ($excludeKeys !== null) { + $keepIndices = []; + foreach ($allValues as $index => $value) { + if (!\in_array($value, $excludeKeys, true)) { + $keepIndices[] = $index; + } + } + $enumKeys = \array_values(\array_intersect_key($allKeys, \array_flip($keepIndices))); + $enumValues = \array_values(\array_intersect_key($allValues, \array_flip($keepIndices))); + } else { + $enumKeys = $allKeys; + $enumValues = $allValues; + } + $node['enum'] = $enumValues; $node['x-enum-name'] = $this->getRequestEnumName($namespace, $methodName, $name); - $node['x-enum-keys'] = $this->getRequestEnumKeys($namespace, $methodName, $name); + $node['x-enum-keys'] = $enumKeys; + + if (!empty($excludeKeys)) { + $node['description'] = $this->parseDescription($node['description'], $excludeKeys); + } } if ($validator->getType() === 'integer') { - $node['format'] = 'int32'; + $node['format'] = $validator->getFormat() ?? 'int32'; } } break; @@ -683,6 +739,10 @@ class Swagger2 extends Format 'x-example' => $node['x-example'] ?? null, ]; + if (isset($node['format'])) { + $body['schema']['properties'][$name]['format'] = $node['format']; + } + if (isset($node['enum'])) { /// If the enum flag is Set, add the enum values to the body $body['schema']['properties'][$name]['enum'] = $node['enum']; @@ -776,7 +836,7 @@ class Swagger2 extends Format case 'integer': $type = 'integer'; - $format = 'int32'; + $format = $rule['format'] ?? 'int32'; break; case 'float': diff --git a/src/Appwrite/Utopia/Database/Documents/User.php b/src/Appwrite/Utopia/Database/Documents/User.php index a85b0a897c..cbd22aaee5 100644 --- a/src/Appwrite/Utopia/Database/Documents/User.php +++ b/src/Appwrite/Utopia/Database/Documents/User.php @@ -7,7 +7,6 @@ use Utopia\Auth\Proofs\Token; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\Role; -use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Roles; class User extends Document @@ -36,11 +35,11 @@ class User extends Document * * @return array */ - public function getRoles(): array + public function getRoles($authorization): array { $roles = []; - if (!$this->isPrivileged(Authorization::getRoles()) && !$this->isApp(Authorization::getRoles())) { + if (!$this->isPrivileged($authorization->getRoles()) && !$this->isApp($authorization->getRoles())) { if ($this->getId()) { $roles[] = Role::user($this->getId())->toString(); $roles[] = Role::users()->toString(); diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index cb449e6ffa..c87279f126 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -214,7 +214,7 @@ class Request extends UtopiaRequest { $forwardedUserAgent = $this->getHeader('x-forwarded-user-agent'); if (!empty($forwardedUserAgent)) { - $roles = Authorization::getRoles(); + $roles = $this->authorization->getRoles(); $isAppUser = User::isApp($roles); if ($isAppUser) { @@ -237,4 +237,11 @@ class Request extends UtopiaRequest ksort($params); return md5($this->getURI() . '*' . serialize($params) . '*' . APP_CACHE_BUSTER); } + + private ?Authorization $authorization = null; + + public function setAuthorization(Authorization $authorization): void + { + $this->authorization = $authorization; + } } diff --git a/src/Appwrite/Utopia/Request/Filter.php b/src/Appwrite/Utopia/Request/Filter.php index 56fed746d9..6d47d4d150 100644 --- a/src/Appwrite/Utopia/Request/Filter.php +++ b/src/Appwrite/Utopia/Request/Filter.php @@ -10,7 +10,7 @@ abstract class Filter private array $params; private ?Database $dbForProject; - public function __construct(Database $dbForProject = null, array $params = []) + public function __construct(?Database $dbForProject = null, array $params = []) { $this->params = $params; $this->dbForProject = $dbForProject; diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php index 69e7da6b7a..e3d5fe2f79 100644 --- a/src/Appwrite/Utopia/Request/Filters/V20.php +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -7,7 +7,6 @@ use Appwrite\Utopia\Request\Filter; use Utopia\Database\Database; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; class V20 extends Filter { @@ -138,7 +137,7 @@ class V20 extends Filter } try { - $database = Authorization::skip(fn () => $dbForProject->getDocument( + $database = $dbForProject->getAuthorization()->skip(fn () => $dbForProject->getDocument( 'databases', $databaseId )); @@ -150,7 +149,7 @@ class V20 extends Filter } try { - $collection = Authorization::skip(fn () => $dbForProject->getDocument( + $collection = $database = $dbForProject->getAuthorization()->skip(fn () => $dbForProject->getDocument( 'database_' . $database->getSequence(), $collectionId )); diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 1dfaa1a41f..f2ac486f82 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -483,7 +483,7 @@ class Response extends SwooleResponse } if ($rule['sensitive']) { - $roles = Authorization::getRoles(); + $roles = $this->authorization->getRoles(); $isPrivilegedUser = DBUser::isPrivileged($roles); $isAppUser = DBUser::isApp($roles); @@ -651,4 +651,11 @@ class Response extends SwooleResponse self::$showSensitive = false; } } + + private ?Authorization $authorization = null; + + public function setAuthorization(Authorization $authorization): void + { + $this->authorization = $authorization; + } } diff --git a/src/Appwrite/Utopia/Response/Model/AttributeInteger.php b/src/Appwrite/Utopia/Response/Model/AttributeInteger.php index fddfe57445..ecdfd38e2d 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeInteger.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeInteger.php @@ -25,6 +25,7 @@ class AttributeInteger extends Attribute ]) ->addRule('min', [ 'type' => self::TYPE_INTEGER, + 'format' => 'int64', 'description' => 'Minimum value to enforce for new documents.', 'default' => null, 'required' => false, @@ -32,6 +33,7 @@ class AttributeInteger extends Attribute ]) ->addRule('max', [ 'type' => self::TYPE_INTEGER, + 'format' => 'int64', 'description' => 'Maximum value to enforce for new documents.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/ColumnInteger.php b/src/Appwrite/Utopia/Response/Model/ColumnInteger.php index 9f6c2c89ab..b248a8d88e 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnInteger.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnInteger.php @@ -25,6 +25,7 @@ class ColumnInteger extends Column ]) ->addRule('min', [ 'type' => self::TYPE_INTEGER, + 'format' => 'int64', 'description' => 'Minimum value to enforce for new documents.', 'default' => null, 'required' => false, @@ -32,6 +33,7 @@ class ColumnInteger extends Column ]) ->addRule('max', [ 'type' => self::TYPE_INTEGER, + 'format' => 'int64', 'description' => 'Maximum value to enforce for new documents.', 'default' => null, 'required' => false, diff --git a/src/Appwrite/Utopia/Response/Model/File.php b/src/Appwrite/Utopia/Response/Model/File.php index 11a128abcc..c4e36286ea 100644 --- a/src/Appwrite/Utopia/Response/Model/File.php +++ b/src/Appwrite/Utopia/Response/Model/File.php @@ -4,6 +4,8 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; +use Utopia\Database\Document; +use Utopia\Storage\Compression\Compression; class File extends Model { @@ -77,6 +79,18 @@ class File extends Model 'default' => 0, 'example' => 17890, ]) + ->addRule('encryption', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether file contents are encrypted at rest.', + 'default' => false, + 'example' => true, + ]) + ->addRule('compression', [ + 'type' => self::TYPE_STRING, + 'description' => 'Compression algorithm used for the file. Will be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd).', + 'default' => '', + 'example' => 'gzip' + ]) ; } @@ -99,4 +113,14 @@ class File extends Model { return Response::MODEL_FILE; } + + public function filter(Document $document): Document + { + $document->setAttribute('compression', $document->getAttribute('algorithm', '')); + + $encryption = !empty($document->getAttribute('openSSLCipher', '')); + $document->setAttribute('encryption', $encryption); + + return $document; + } } diff --git a/src/Appwrite/Utopia/Response/Model/Message.php b/src/Appwrite/Utopia/Response/Model/Message.php index 4c1e08b9cb..95b965fa1a 100644 --- a/src/Appwrite/Utopia/Response/Model/Message.php +++ b/src/Appwrite/Utopia/Response/Model/Message.php @@ -98,7 +98,7 @@ class Message extends Model 'type' => self::TYPE_ENUM, 'description' => 'Status of delivery.', 'default' => 'draft', - 'example' => 'Message status can be one of the following: draft, processing, scheduled, sent, or failed.', + 'example' => 'processing', 'enum' => ['draft', 'processing', 'scheduled', 'sent', 'failed'], ]); } diff --git a/tests/e2e/Services/Databases/Legacy/Permissions/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/Legacy/Permissions/DatabasesPermissionsGuestTest.php index 6496aa285a..0c9854160e 100644 --- a/tests/e2e/Services/Databases/Legacy/Permissions/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/Legacy/Permissions/DatabasesPermissionsGuestTest.php @@ -17,6 +17,19 @@ class DatabasesPermissionsGuestTest extends Scope use SideClient; use DatabasesPermissionsScope; + private $authorization; + + public function getAuthorization(): Authorization + { + if (isset($this->authorization)) { + return $this->authorization; + } + + $this->authorization = new Authorization(); + + return $this->authorization; + } + public function createCollection(): array { $database = $this->client->call(Client::METHOD_POST, '/databases', array_merge([ @@ -111,8 +124,8 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(201, $publicResponse['headers']['status-code']); $this->assertEquals(201, $privateResponse['headers']['status-code']); - $roles = Authorization::getRoles(); - Authorization::cleanRoles(); + $roles = $this->getAuthorization()->getRoles(); + $this->getAuthorization()->cleanRoles(); $publicDocuments = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', @@ -134,7 +147,7 @@ class DatabasesPermissionsGuestTest extends Scope } foreach ($roles as $role) { - Authorization::setRole($role); + $this->getAuthorization()->addRole($role); } } @@ -145,8 +158,8 @@ class DatabasesPermissionsGuestTest extends Scope $privateCollectionId = $data['privateCollectionId']; $databaseId = $data['databaseId']; - $roles = Authorization::getRoles(); - Authorization::cleanRoles(); + $roles = $this->getAuthorization()->getRoles(); + $this->getAuthorization()->cleanRoles(); $publicResponse = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', @@ -222,7 +235,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(401, $privateDocument['headers']['status-code']); foreach ($roles as $role) { - Authorization::setRole($role); + $this->getAuthorization()->addRole($role); } } diff --git a/tests/e2e/Services/Databases/TablesDB/Permissions/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/TablesDB/Permissions/DatabasesPermissionsGuestTest.php index 2f69c037d0..84cb4bce3a 100644 --- a/tests/e2e/Services/Databases/TablesDB/Permissions/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/TablesDB/Permissions/DatabasesPermissionsGuestTest.php @@ -17,6 +17,19 @@ class DatabasesPermissionsGuestTest extends Scope use SideClient; use DatabasesPermissionsScope; + private $authorization; + + public function getAuthorization(): Authorization + { + if (isset($this->authorization)) { + return $this->authorization; + } + + $this->authorization = new Authorization(); + return $this->authorization; + } + + public function createTable(): array { $database = $this->client->call(Client::METHOD_POST, '/tablesdb', array_merge([ @@ -111,8 +124,8 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(201, $publicResponse['headers']['status-code']); $this->assertEquals(201, $privateResponse['headers']['status-code']); - $roles = Authorization::getRoles(); - Authorization::cleanRoles(); + $roles = $this->getAuthorization()->getRoles(); + $this->getAuthorization()->cleanRoles(); $publicRows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows', [ 'content-type' => 'application/json', @@ -134,7 +147,7 @@ class DatabasesPermissionsGuestTest extends Scope } foreach ($roles as $role) { - Authorization::setRole($role); + $this->getAuthorization()->addRole($role); } } @@ -145,8 +158,8 @@ class DatabasesPermissionsGuestTest extends Scope $privateTableId = $data['privateTableId']; $databaseId = $data['databaseId']; - $roles = Authorization::getRoles(); - Authorization::cleanRoles(); + $roles = $this->getAuthorization()->getRoles(); + $this->getAuthorization()->cleanRoles(); $publicResponse = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $publicTableId . '/rows', [ 'content-type' => 'application/json', @@ -222,7 +235,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(401, $privateRow['headers']['status-code']); foreach ($roles as $role) { - Authorization::setRole($role); + $this->getAuthorization()->addRole($role); } } diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index ec9f0d0cc7..0337856779 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -1447,4 +1447,117 @@ class StorageCustomClientTest extends Scope ]); $this->assertEquals(204, $response['headers']['status-code']); } + + public function testFileEncryptionAndCompression(): void + { + // Create bucket + $bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'bucketId' => ID::unique(), + 'name' => 'Test Bucket', + 'permissions' => [ + Permission::read(Role::any()) + ], + 'encryption' => true, + 'compression' => 'gzip' + ]); + $this->assertSame(201, $bucket['headers']['status-code']); + + // Create file + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucket['body']['$id'] . '/files', [ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'transformations.png'), + ]); + $this->assertSame(201, $file['headers']['status-code']); + $this->assertSame('gzip', $file['body']['compression']); + $this->assertSame(true, $file['body']['encryption']); + + // Get file + $file = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'], [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertSame(200, $file['headers']['status-code']); + $this->assertSame('gzip', $file['body']['compression']); + $this->assertSame(true, $file['body']['encryption']); + + // List files + $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertSame(200, $files['headers']['status-code']); + $this->assertSame(1, $files['body']['total']); + $this->assertSame('gzip', $files['body']['files'][0]['compression']); + $this->assertSame(true, $files['body']['files'][0]['encryption']); + + // Update the bucket + $bucket = $this->client->call(Client::METHOD_PUT, '/storage/buckets/' . $bucket['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'name' => 'Test Bucket', + 'encryption' => false, + 'compression' => 'none' + ]); + + // Existing file did not update + $file = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'], [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertSame(200, $file['headers']['status-code']); + $this->assertSame('gzip', $file['body']['compression']); + $this->assertSame(true, $file['body']['encryption']); + + // Create 2nd file + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucket['body']['$id'] . '/files', [ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'transformations.png'), + ]); + $this->assertSame(201, $file['headers']['status-code']); + $this->assertSame('none', $file['body']['compression']); + $this->assertSame(false, $file['body']['encryption']); + + // Get file + $file = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'], [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertSame(200, $file['headers']['status-code']); + $this->assertSame('none', $file['body']['compression']); + $this->assertSame(false, $file['body']['encryption']); + + // List files + $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files', [ + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertSame(200, $files['headers']['status-code']); + $this->assertSame(2, $files['body']['total']); + $this->assertSame('none', $files['body']['files'][1]['compression']); + $this->assertSame(false, $files['body']['files'][1]['encryption']); + $this->assertSame('gzip', $files['body']['files'][0]['compression']); + $this->assertSame(true, $files['body']['files'][0]['encryption']); + + // Delete the bucket + $response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucket['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + $this->assertEquals(204, $response['headers']['status-code']); + } } diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index a4461c06c2..ca6feed5fa 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -94,7 +94,7 @@ trait TokensBase $this->assertEquals(401, $failedPreview['body']['code']); $this->assertEquals(401, $failedPreview['headers']['status-code']); $this->assertEquals('user_unauthorized', $failedPreview['body']['type']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $failedPreview['body']['message']); + $this->assertEquals('No permissions provided for action \'read\'', $failedPreview['body']['message']); // Extended file preview. Should fail as an anonymous user with no form of any access to the file. $failedCustomPreview = $this->client->call( @@ -113,7 +113,7 @@ trait TokensBase $this->assertEquals(401, $failedCustomPreview['body']['code']); $this->assertEquals(401, $failedCustomPreview['headers']['status-code']); $this->assertEquals('user_unauthorized', $failedCustomPreview['body']['type']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $failedCustomPreview['body']['message']); + $this->assertEquals('No permissions provided for action \'read\'', $failedCustomPreview['body']['message']); // File view. Should fail as an anonymous user with no form of any access to the file. $failedView = $this->client->call( @@ -124,7 +124,7 @@ trait TokensBase $this->assertEquals(401, $failedView['body']['code']); $this->assertEquals(401, $failedView['headers']['status-code']); $this->assertEquals('user_unauthorized', $failedView['body']['type']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $failedView['body']['message']); + $this->assertEquals('No permissions provided for action \'read\'', $failedView['body']['message']); // File download. Should fail as an anonymous user with no form of any access to the file. $failedDownload = $this->client->call( @@ -135,7 +135,7 @@ trait TokensBase $this->assertEquals(401, $failedDownload['body']['code']); $this->assertEquals(401, $failedDownload['headers']['status-code']); $this->assertEquals('user_unauthorized', $failedDownload['body']['type']); - $this->assertEquals('The current user is not authorized to perform the requested action.', $failedDownload['body']['message']); + $this->assertEquals('No permissions provided for action \'read\'', $failedDownload['body']['message']); return $data; } diff --git a/tests/unit/Messaging/MessagingChannelsTest.php b/tests/unit/Messaging/MessagingChannelsTest.php index 42e433568f..7df5b8d1e6 100644 --- a/tests/unit/Messaging/MessagingChannelsTest.php +++ b/tests/unit/Messaging/MessagingChannelsTest.php @@ -7,6 +7,7 @@ use Appwrite\Utopia\Database\Documents\User; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\Authorization; class MessagingChannelsTest extends TestCase { @@ -33,6 +34,19 @@ class MessagingChannelsTest extends TestCase 'functions.1', ]; + + private $authorization; + + public function getAuthorization(): Authorization + { + if (isset($this->authorization)) { + return $this->authorization; + } + + $this->authorization = new Authorization(); + return $this->authorization; + } + public function setUp(): void { /** @@ -65,7 +79,7 @@ class MessagingChannelsTest extends TestCase ] ]); - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $parsedChannels = Realtime::convertChannels([0 => $channel], $user->getId()); @@ -89,7 +103,7 @@ class MessagingChannelsTest extends TestCase '$id' => '' ]); - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $parsedChannels = Realtime::convertChannels([0 => $channel], $user->getId()); diff --git a/tests/unit/Utopia/Database/Documents/UserTest.php b/tests/unit/Utopia/Database/Documents/UserTest.php index 4675e8d73f..d5706e7bec 100644 --- a/tests/unit/Utopia/Database/Documents/UserTest.php +++ b/tests/unit/Utopia/Database/Documents/UserTest.php @@ -14,13 +14,25 @@ use Utopia\Database\Validator\Roles; class UserTest extends TestCase { + private $authorization; + + public function getAuthorization(): Authorization + { + if (isset($this->authorization)) { + return $this->authorization; + } + + $this->authorization = new Authorization(); + return $this->authorization; + } + /** * Reset Roles */ public function tearDown(): void { - Authorization::cleanRoles(); - Authorization::setRole(Role::any()->toString()); + $this->getAuthorization()->cleanRoles(); + $this->getAuthorization()->addRole(Role::any()->toString()); } public function testSessionVerify(): void @@ -197,7 +209,7 @@ class UserTest extends TestCase '$id' => '' ]); - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertCount(1, $roles); $this->assertContains(Role::guests()->toString(), $roles); } @@ -233,7 +245,7 @@ class UserTest extends TestCase ] ]); - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertCount(13, $roles); $this->assertContains(Role::users()->toString(), $roles); @@ -254,21 +266,21 @@ class UserTest extends TestCase $user['emailVerification'] = false; $user['phoneVerification'] = false; - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertContains(Role::users(Roles::DIMENSION_UNVERIFIED)->toString(), $roles); $this->assertContains(Role::user(ID::custom('123'), Roles::DIMENSION_UNVERIFIED)->toString(), $roles); // Enable single verification type $user['emailVerification'] = true; - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertContains(Role::users(Roles::DIMENSION_VERIFIED)->toString(), $roles); $this->assertContains(Role::user(ID::custom('123'), Roles::DIMENSION_VERIFIED)->toString(), $roles); } public function testPrivilegedUserRoles(): void { - Authorization::setRole(User::ROLE_OWNER); + $this->getAuthorization()->addRole(User::ROLE_OWNER); $user = new User([ '$id' => ID::custom('123'), 'emailVerification' => true, @@ -293,8 +305,7 @@ class UserTest extends TestCase ] ] ]); - - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertCount(7, $roles); $this->assertNotContains(Role::users()->toString(), $roles); @@ -312,7 +323,7 @@ class UserTest extends TestCase public function testAppUserRoles(): void { - Authorization::setRole(User::ROLE_APPS); + $this->getAuthorization()->addRole(User::ROLE_APPS); $user = new User([ '$id' => ID::custom('123'), 'memberships' => [ @@ -336,7 +347,7 @@ class UserTest extends TestCase ] ]); - $roles = $user->getRoles(); + $roles = $user->getRoles($this->getAuthorization()); $this->assertCount(7, $roles); $this->assertNotContains(Role::users()->toString(), $roles);